class CloudmersiveVideoApiClient::AudioApi
Attributes
Public Class Methods
# File lib/cloudmersive-video-api-client/api/audio_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Convert Audio File to AAC format. Automatically detect audio file format and convert it to AAC format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB. @param [Hash] opts the optional parameters @option opts [File] :input_file Input file to perform the operation on. @option opts [String] :file_url Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB. @option opts [Integer] :bit_rate Optional; Specify the desired bitrate of the converted audio file in kilobytes per second (kB/s). Value may be between 48 and 1,411. By default, the optimal bitrate will be chosen automatically. @return [String]
# File lib/cloudmersive-video-api-client/api/audio_api.rb, line 29 def audio_convert_to_aac(opts = {}) data, _status_code, _headers = audio_convert_to_aac_with_http_info(opts) data end
Convert Audio File to AAC format. Automatically detect audio file format and convert it to AAC format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB. @param [Hash] opts the optional parameters @option opts [File] :input_file Input file to perform the operation on. @option opts [String] :file_url Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB. @option opts [Integer] :bit_rate Optional; Specify the desired bitrate of the converted audio file in kilobytes per second (kB/s). Value may be between 48 and 1,411. By default, the optimal bitrate will be chosen automatically. @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
# File lib/cloudmersive-video-api-client/api/audio_api.rb, line 41 def audio_convert_to_aac_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AudioApi.audio_convert_to_aac ...' end # resource path local_var_path = '/video/convert/to/aac' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil? header_params[:'bitRate'] = opts[:'bit_rate'] if !opts[:'bit_rate'].nil? # form parameters form_params = {} form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil? # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: AudioApi#audio_convert_to_aac\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Convert Audio File to M4A format. Automatically detect audio file format and convert it to M4A format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB. @param [Hash] opts the optional parameters @option opts [File] :input_file Input file to perform the operation on. @option opts [String] :file_url Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB. @option opts [Integer] :bit_rate Optional; Specify the desired bitrate of the converted audio file in kilobytes per second (kB/s). Value may be between 48 and 1,411. By default, the optimal bitrate will be chosen automatically. @return [String]
# File lib/cloudmersive-video-api-client/api/audio_api.rb, line 86 def audio_convert_to_m4a(opts = {}) data, _status_code, _headers = audio_convert_to_m4a_with_http_info(opts) data end
Convert Audio File to M4A format. Automatically detect audio file format and convert it to M4A format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB. @param [Hash] opts the optional parameters @option opts [File] :input_file Input file to perform the operation on. @option opts [String] :file_url Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB. @option opts [Integer] :bit_rate Optional; Specify the desired bitrate of the converted audio file in kilobytes per second (kB/s). Value may be between 48 and 1,411. By default, the optimal bitrate will be chosen automatically. @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
# File lib/cloudmersive-video-api-client/api/audio_api.rb, line 98 def audio_convert_to_m4a_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AudioApi.audio_convert_to_m4a ...' end # resource path local_var_path = '/video/convert/to/m4a' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil? header_params[:'bitRate'] = opts[:'bit_rate'] if !opts[:'bit_rate'].nil? # form parameters form_params = {} form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil? # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: AudioApi#audio_convert_to_m4a\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Convert Audio File to MP3 format. Automatically detect audio file format and convert it to MP3 format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB. @param [Hash] opts the optional parameters @option opts [File] :input_file Input file to perform the operation on. @option opts [String] :file_url Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB. @option opts [Integer] :bit_rate Optional; Specify the desired bitrate of the converted audio file in kilobytes per second (kB/s). Value may be between 48 and 1,411. By default, the optimal bitrate will be chosen automatically. @return [String]
# File lib/cloudmersive-video-api-client/api/audio_api.rb, line 143 def audio_convert_to_mp3(opts = {}) data, _status_code, _headers = audio_convert_to_mp3_with_http_info(opts) data end
Convert Audio File to MP3 format. Automatically detect audio file format and convert it to MP3 format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB. @param [Hash] opts the optional parameters @option opts [File] :input_file Input file to perform the operation on. @option opts [String] :file_url Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB. @option opts [Integer] :bit_rate Optional; Specify the desired bitrate of the converted audio file in kilobytes per second (kB/s). Value may be between 48 and 1,411. By default, the optimal bitrate will be chosen automatically. @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
# File lib/cloudmersive-video-api-client/api/audio_api.rb, line 155 def audio_convert_to_mp3_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AudioApi.audio_convert_to_mp3 ...' end # resource path local_var_path = '/video/convert/to/mp3' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil? header_params[:'bitRate'] = opts[:'bit_rate'] if !opts[:'bit_rate'].nil? # form parameters form_params = {} form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil? # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: AudioApi#audio_convert_to_mp3\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Convert Audio File to WAV format. Automatically detect audio file format and convert it to WAV format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB. @param [Hash] opts the optional parameters @option opts [File] :input_file Input file to perform the operation on. @option opts [String] :file_url Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB. @option opts [Float] :sample_rate Optional; Specify the desired sample rate of the converted audio file in kHz. Value may be between 8 and 96. Standard for audio CDs is 44.1, while DVD audio standard is 48. By default, the optimal sample rate will be chosen automatically. @return [String]
# File lib/cloudmersive-video-api-client/api/audio_api.rb, line 200 def audio_convert_to_wav(opts = {}) data, _status_code, _headers = audio_convert_to_wav_with_http_info(opts) data end
Convert Audio File to WAV format. Automatically detect audio file format and convert it to WAV format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB. @param [Hash] opts the optional parameters @option opts [File] :input_file Input file to perform the operation on. @option opts [String] :file_url Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB. @option opts [Float] :sample_rate Optional; Specify the desired sample rate of the converted audio file in kHz. Value may be between 8 and 96. Standard for audio CDs is 44.1, while DVD audio standard is 48. By default, the optimal sample rate will be chosen automatically. @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
# File lib/cloudmersive-video-api-client/api/audio_api.rb, line 212 def audio_convert_to_wav_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AudioApi.audio_convert_to_wav ...' end # resource path local_var_path = '/video/convert/to/wav' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil? header_params[:'sampleRate'] = opts[:'sample_rate'] if !opts[:'sample_rate'].nil? # form parameters form_params = {} form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil? # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: AudioApi#audio_convert_to_wav\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end