Open Darkov3 opened 6 months ago
To troubleshoot, I'd start by saving the whole thing to an aac file. Then see if Windows Media Player (or similar) can play it succesfully. And then see what using MediaFoundationReader can do.
Also, you shouldn't need the WaveFormatConversion step. StreamMediaFoundationReader should already be outputting PCM decoded audio.
It does play, I have tested it. Here is the file, it is generated by OpenAI's TTS model: https://jmp.sh/s/LN8JSQedvzUrIUEoTskC
I have not tried it with MediaFoundationReader, shouldn't StreamMediaFoundationReader do the same, but from a stream?
edit: seems the file was deleted, will upload it somewhere else
I have the following code to play/pause/stop an *.aac audio file, that I download from an API and I store as a byte array:
I play it like this:
The AudioTimer calls this code to know when to stop the audio file and an UI element updates to show progress:
I have little knowledge about how Audio Files work in general, but I have gotten it to work with an MP3 and Opus (using Concentus too) file. I found this online, but because I do not quite understand how everything works, I am not sure if its related or not and how to fix it: https://stackoverflow.com/questions/37734341/aac-and-naudio-sampling-rate-mismatch
I even tried to change the sample rate like this:
But it was either too fast or too slow.