• Advertisement
Sign in to follow this  

Wav - Ogg == Chipmunk

This topic is 3769 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I’m creating an ogg\vorbis encoder/decoder that takes pcm wav data and encodes it to ogg on the fly. It works fine but only if I use sample rate 44100, bit rate 48000, and 2 channels. I need to be able to use just 1 channel but when I do that it comes out sounding like chipmunks. I’ve been searching around and looking at other peoples examples but can’t see what I’m doing wrong. Any ideas? Let me know if you need more info or need to see some code and if possible what aspect.

Share this post


Link to post
Share on other sites
Advertisement
I can't recall for sure, but I don't think vorbis supports 1 channel audio. Are you actually trying to encode/decode vorbis, or are you just putting PCM data in an ogg stream?

Share this post


Link to post
Share on other sites
What I’m doing is taking pcm wav data, encoding it, and then writing it to the ogg file. The decoding and play back works fine, it’s just that the encoding doesn’t seem to like 1 channel. I’m pretty sure that it does support it because I remember seeming some examples that had that option. Couldn’t figure out what I was doing different though. I’ll look into that though to make sure.

Share this post


Link to post
Share on other sites
Are you perhaps trying to play it back as a 2 channel sound, when it is encoded as a 1 channel sound? That would cause the chipmunk sound.

Share this post


Link to post
Share on other sites
You decode to PCM, correct? If you for some reason mismarked it as a 2 channel PCM file when you decode rather than a 1 channel, it would play twice as fast as it should.

Share this post


Link to post
Share on other sites
Well shit, yeah that actually seems to be the problem. I am using vorbis_info function to get the channels but it doesn't seem to be returning the correct number. To add to my confusion, VLC doesn't play the recorded file correctly either. When i hardcode the channel to 1 it decodes it correctly though. I'll have to look into that and see what the hell it's doing.

I've been fighting this thing for a week. I should have known it was going to be something stupid.

Thanks for your help!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement