-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NAudio: Adpcm stream relies on Windows.Media player #8
Comments
I thought I fixed this but i just ran it in linux and realized the function that wasn't working i was using |
Yeah, that's mostly because PCMs are Windows natively supported. NAudio passes the PCM stream probably to IDirectSoundBuffer that doesn't exist on Linux. Recently I was working with FFMpeg. My idea is to use that instead of NAudio and let Monogame play the pre-converted sound, but FFMpeg is unmanaged type, so that might need a lot of marshaling. This will be for sure something I'll be working on after I finish battle stage camera + monster rendering |
I think my class can be made to read these and convert to pcm. After I got it to run on Linux I am planning to take a look at it. |
From what I gather if I don't pass data that will play in vlc or something it won't work. So I've been trying to learn how to format the raw adpcm wave data with a header in hopes that players will play it. using http://wiki.ffrtt.ru/index.php/FF8/FileFormat_FMT and http://icculus.org/SDL_sound/downloads/external_documentation/wavecomp.htm for reference and your working code. Maybe i should save a file using naudio and see what it does differently. |
http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html and this http://www.cplusplus.com/forum/beginner/166954/ kinda helped. Got code that write wav files now. woo! there still compressed. I think now I can swap the filestream for a memory stream then send that data to ffmpeg to decode it for playback. None of the software understood what it was without a properly formatted header. |
Okay I have sound playback working on linux. But, it's kinda a hack. I currently need to write the adpcm files to valid RIFF wav files. Then read then into ffmpeg the normal way. I had issues like I hard coded stereo and 44100 or 48000. So if anything was mono or another sample rate it wouldn't work. Decode() function didn't work with any files that were more than one frame per packet. Most of the adpcm files were multiple frames per packet. I still want to load the sound from memory instead of using the hard drive. |
Okay I have something functional that doesn't write wav files to play them. I'll close this and do a pull request. Might need optimizations. It plays in linux but it's a bit delayed on my virtualbox instance. |
Find another way to play pre-converted sounds from NAudio adpcm to WavPCM
The text was updated successfully, but these errors were encountered: