IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Ogg Vorbis and WAVEFORMATEXTENSIBLE
Zerox Millienium
post Aug 4 2006, 17:38
Post #1





Group: Members
Posts: 9
Joined: 13-April 04
Member No.: 13453




How do I use Ogg Vorbis file with WAVEFORMATEXTENSIBLE?

I'm using libvorbisfile to open an ogg vorbis file and playing it using DirectSound but faced with the difficulty of filling in the information needed to be passed to the DSBUFFERDESC data structure.

I managed to use ov_info() to obtain the sampling rate (48,000Hz for quality 10 ogg) and the number of channels (usually 2 in my case). But there isn't any attribute of bits per sample (8 or 16).

Please guide me on this one, thanks. Currently, I am only capable of filling my own settings to WAVEFORMATEX data structure instead playing at 16 bits, 44,100Hz, 2 channels. This is clearly different from the ogg vorbis sample file I'm using which is of 48,000Hz. Therefore I must use WAVEFORMATEXTENSIBLE.
Go to the top of the page
+Quote Post
john33
post Aug 7 2006, 10:58
Post #2


xcLame and OggDropXPd Developer


Group: Developer
Posts: 3760
Joined: 30-September 01
From: Bracknell, UK
Member No.: 111



If you're using ov_read, then you supply the required output bit depth - 8 or 16 bit - as a parameter to the function. Alternatively, you can use ov_read_float and the decoded output is supplied, unsurprisingly, as 32 bit floats and you can then play with that as you wish.

If you are dealing with files with more than 2 channels, how you map the output channels will depend on how the input was mapped. The internal ogg vorbis channel order is different from WAVEFORMATEXTENSIBLE. The vorbis I spec details the internal order, so far as they have been specified.


--------------------
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th September 2014 - 18:02