audio-converter

Convert 8kHz mulaw to 16KHz PCM in real time

最后都变了- 提交于 2020-04-11 04:36:23
问题 In my POC I'm receiving a conversation streaming from Twilio in 8kHz mulaw and I want to transcribe it using Amazon Transcribe that needs to get the audio in 16KHz and PCM. I found here how to convert a file but failed to do this in streaming... The code for a file is: File sourceFile = new File("<Source_Path>.wav"); File targetFile = new File("<Destination_Path>.wav"); AudioInputStream sourceAudioInputStream = AudioSystem.getAudioInputStream(sourceFile); AudioInputStream

Convert 8kHz mulaw to 16KHz PCM in real time

百般思念 提交于 2020-04-11 04:36:19
问题 In my POC I'm receiving a conversation streaming from Twilio in 8kHz mulaw and I want to transcribe it using Amazon Transcribe that needs to get the audio in 16KHz and PCM. I found here how to convert a file but failed to do this in streaming... The code for a file is: File sourceFile = new File("<Source_Path>.wav"); File targetFile = new File("<Destination_Path>.wav"); AudioInputStream sourceAudioInputStream = AudioSystem.getAudioInputStream(sourceFile); AudioInputStream

How do I use CoreAudio's AudioConverter to encode AAC in real-time?

随声附和 提交于 2020-01-09 09:17:26
问题 All the sample code I can find that uses AudioConverterRef focuses on use cases where I have all the data up-front (such as converting a file on disk). They commonly call AudioConverterFillComplexBuffer with the PCM to be converted as the inInputDataProcUserData and just fill it in in the callback. (Is that really how it's supposed to be used? Why does it need a callback, then?) For my use case, I'm trying to stream aac audio from the microphone, so I have no file, and my PCM buffer is being

OS X / iOS - Sample rate conversion for a buffer using AudioConverterFillComplexBuffer

偶尔善良 提交于 2019-12-31 09:05:14
问题 I'm writing a CoreAudio backend for an audio library called XAL. Input buffers can be of various sample rates. I'm using a single audio unit for output. Idea is to convert the buffers and mix them prior to sending them to the audio unit. Everything works as long as the input buffer has the same properties (sample rate, channel count, etc) as the output audio unit. Hence, the mixing part works. However, I'm stuck with sample rate and channel count conversion. From what I figured out, this is

Convert mp3 to wav on Android

筅森魡賤 提交于 2019-12-10 10:59:19
问题 There seem to be a lot of questions regarding the inverse wav to mp3 conversion, but none to go the other way. My situation is that I can use steganography to embed data in wav files. I can convert these to ogg and back (the steganography is format independent, and can survive format conversion). What I want to do now is build in AudioBoo integration. Uploading to AudioBoo is not a problem, retrieving the files in mp3 format is not a problem, but converting those mp3 files back to wav to

Unable to convert mp3 into PCM using AudioConverterFillComplexBuffer in AudioFileStreamOpen's AudioFileStream_PacketsProc callback

雨燕双飞 提交于 2019-12-04 17:39:57
问题 I have a AudioFileStream_PacketsProc callback set during an AudioFileStreamOpen which handles converting audio packets into PCM using AudioConverterFillComplexBuffer . The issue that I am having is that I am getting a -50 OSStatus (paramErr) after AudioConverterFillComplexBuffer is called. Below is a snippet of what parameters were used in AudioConverterFillComplexBuffer and how they were made: audioConverterRef = AudioConverterRef() // AudioConvertInfo is a struct that contains information /

Unable to convert mp3 into PCM using AudioConverterFillComplexBuffer in AudioFileStreamOpen's AudioFileStream_PacketsProc callback

好久不见. 提交于 2019-12-03 10:35:12
I have a AudioFileStream_PacketsProc callback set during an AudioFileStreamOpen which handles converting audio packets into PCM using AudioConverterFillComplexBuffer . The issue that I am having is that I am getting a -50 OSStatus (paramErr) after AudioConverterFillComplexBuffer is called. Below is a snippet of what parameters were used in AudioConverterFillComplexBuffer and how they were made: audioConverterRef = AudioConverterRef() // AudioConvertInfo is a struct that contains information // for the converter regarding the number of packets and // which audiobuffer is being allocated

How do I use CoreAudio's AudioConverter to encode AAC in real-time?

若如初见. 提交于 2019-11-28 06:38:57
All the sample code I can find that uses AudioConverterRef focuses on use cases where I have all the data up-front (such as converting a file on disk). They commonly call AudioConverterFillComplexBuffer with the PCM to be converted as the inInputDataProcUserData and just fill it in in the callback. (Is that really how it's supposed to be used? Why does it need a callback, then?) For my use case, I'm trying to stream aac audio from the microphone, so I have no file, and my PCM buffer is being filled in in real time. Since I don't have all the data up-front, I've tried doing *ioNumberDataPackets

How do you check a file type when there is no extension in c#

≯℡__Kan透↙ 提交于 2019-11-27 07:11:21
问题 How do you check a file type when there is no extension in c# For instance, I have files with no extension, that are either .mp4 or .flv format (just no extension). I plan on converting these video files to audio files however I would like to determine the file type before I start converting it. Is there a way to do this in C#? I was thinking that maybe I could just rename the file to name.mp4, then perform some task on the file that would either A) succeed, meaning that the file was indeed