View mode: basic / threaded / horizontal-split · Log in · Help
July 08, 2012
read Ogg/Mp3 file
Has anyone experience with reading of .Ogg or .Mp3 files and can 
give me a briefing?
Or does anyone know if sndfile.h was ported to D?
July 08, 2012
Re: read Ogg/Mp3 file
On 2012-07-08 12:03, Namespace wrote:
> Has anyone experience with reading of .Ogg or .Mp3 files and can give me
> a briefing?
> Or does anyone know if sndfile.h was ported to D?

Try running it through DStep: 
http://forum.dlang.org/thread/jt9i6l$2go5$1@digitalmars.com

-- 
/Jacob Carlborg
July 08, 2012
Re: read Ogg/Mp3 file
Am Sun, 08 Jul 2012 12:03:06 +0200
schrieb "Namespace" <rswhite4@googlemail.com>:

> Has anyone experience with reading of .Ogg or .Mp3 files and can 
> give me a briefing?
> Or does anyone know if sndfile.h was ported to D?

I haven't used it yet, but here's a derelict-style binding for sndfile:
https://github.com/p0nce/DerelictSndFile
July 08, 2012
Re: read Ogg/Mp3 file
Am 08.07.2012 12:03, schrieb Namespace:
> Has anyone experience with reading of .Ogg or .Mp3 files and can give me
> a briefing?
> Or does anyone know if sndfile.h was ported to D?

I'm using libvorbis to read and OpenAL to playback .ogg files. The 
functions you need to import are really minimal. There are good samples 
on the vorbis side how to read in ogg files and openal is also not 
really complicated. I can post code if you want.

Kind Regards
Ingrater
July 08, 2012
Re: read Ogg/Mp3 file
On Sunday, 8 July 2012 at 13:42:39 UTC, Benjamin Thaut wrote:
> Am 08.07.2012 12:03, schrieb Namespace:
>> Has anyone experience with reading of .Ogg or .Mp3 files and 
>> can give me
>> a briefing?
>> Or does anyone know if sndfile.h was ported to D?
>
> I'm using libvorbis to read and OpenAL to playback .ogg files. 
> The functions you need to import are really minimal. There are 
> good samples on the vorbis side how to read in ogg files and 
> openal is also not really complicated. I can post code if you 
> want.
>
> Kind Regards
> Ingrater

Yes .ogg files and even .wav works since today. But reading mp3 
should be even simple as .ogg files, or not?
July 08, 2012
Re: read Ogg/Mp3 file
Am 08.07.2012 16:32, schrieb Namespace:
> On Sunday, 8 July 2012 at 13:42:39 UTC, Benjamin Thaut wrote:
>> Am 08.07.2012 12:03, schrieb Namespace:
>>> Has anyone experience with reading of .Ogg or .Mp3 files and can give me
>>> a briefing?
>>> Or does anyone know if sndfile.h was ported to D?
>>
>> I'm using libvorbis to read and OpenAL to playback .ogg files. The
>> functions you need to import are really minimal. There are good
>> samples on the vorbis side how to read in ogg files and openal is also
>> not really complicated. I can post code if you want.
>>
>> Kind Regards
>> Ingrater
>
> Yes .ogg files and even .wav works since today. But reading mp3 should
> be even simple as .ogg files, or not?

Well .ogg and .mp3 are quite similar in compression technology. But you 
will need a mp3 library to read them. I don't know a opensource one.
July 08, 2012
Re: read Ogg/Mp3 file
> Well .ogg and .mp3 are quite similar in compression technology. 
> But you will need a mp3 library to read them. I don't know a 
> opensource one.

I cannot open and read them like .wav files, simply with FILE* 
and fread? o.O
I thougth i only need the structure of mp3 files and then i can 
read them.
July 08, 2012
Re: read Ogg/Mp3 file
Am 08.07.2012 16:59, schrieb Namespace:
>> Well .ogg and .mp3 are quite similar in compression technology. But
>> you will need a mp3 library to read them. I don't know a opensource one.
>
> I cannot open and read them like .wav files, simply with FILE* and
> fread? o.O
> I thougth i only need the structure of mp3 files and then i can read them.

Well yes, if you write your own mp3 decoder then you can do that. But 
the sound information within mp3s is compressed using inverse fourier 
transform and some other fancy math stuff. It will take quite some time 
to write all the code neccessary for reading the whole format.

Kind Regards
Benjamin Thaut
July 08, 2012
Re: read Ogg/Mp3 file
> Well yes, if you write your own mp3 decoder then you can do 
> that. But the sound information within mp3s is compressed using 
> inverse fourier transform and some other fancy math stuff. It 
> will take quite some time to write all the code neccessary for 
> reading the whole format.
>
> Kind Regards
> Benjamin Thaut

Ah, ok, i thought it would be so easy like reading .wav files.
Top | Discussion index | About this forum | D home