Page 1 of 1

Wii PCM 16 bit samples ASNDLIB

Posted: Wed Aug 22, 2018 1:47 pm
by msmalik681
I am using asndlib and it will play 8 bit mono pcm samples just fine. 16 bit mono pcm samples are just static. Here is a link to the source code if anyone can please help.

https://github.com/DCurrent/openbor/blo ... sblaster.c

Re: Wii PCM 16 bit samples ASNDLIB

Posted: Sat Sep 15, 2018 7:37 pm
by WinterMute
If it's really 16bit mono then you probably want VOICE_MONO_16BIT_LE rather than VOICE_STEREO_16BIT. Suspect it sounds like static because you're trying to play little endian samples in big endian mode.

Re: Wii PCM 16 bit samples ASNDLIB

Posted: Sat Jan 19, 2019 6:30 pm
by msmalik681
That did not work I tried them all. The audio documentation states the output sample will always be converted to 16 bit stereo anyway.

Is there anyway to check the input sample and if it is 16 bit mono pcm convert it to 8 bit mono pcm ? I did not write this code I just hope I can edit it to fix this little bug.

Also the engine can play all formats of audio in mp3 and ogg format it also plays 8 bit mono pcm samples just fine the only issue is only with 16 mono samples.

Re: Wii PCM 16 bit samples ASNDLIB

Posted: Sat Jan 19, 2019 7:19 pm
by WinterMute
Is there any chance you could put together a small test case for us to look at? Just the code you're using to play a sample & a couple of the samples that are failing - might be easier to figure out what's going wrong.

Re: Wii PCM 16 bit samples ASNDLIB

Posted: Sat Jan 19, 2019 9:03 pm
by msmalik681
Do you mean compile and recording the application while its playing 8 and 16 bit samples ?

Re: Wii PCM 16 bit samples ASNDLIB

Posted: Sun Jan 20, 2019 5:14 pm
by WinterMute
msmalik681 wrote:Do you mean compile and recording the application while its playing 8 and 16 bit samples ?
No, I mean just providing a small project we can compile that illustrates the problem.

Re: Wii PCM 16 bit samples ASNDLIB

Posted: Sun Jan 20, 2019 6:04 pm
by msmalik681
Sounds like more then can do lol.

I have spoken to one of the developers who thinks the 16 bit sample needs to be bit swapped to big edian.

Re: Wii PCM 16 bit samples ASNDLIB

Posted: Wed Jan 23, 2019 3:10 am
by WinterMute
msmalik681 wrote:Sounds like more then can do lol.

I have spoken to one of the developers who thinks the 16 bit sample needs to be bit swapped to big edian.
Can you at least supply one or two of the problematic samples?

changing endianness is done by bytes swaps, not bit swaps. In any case asndlib should be able to handle it just fine.