DSPRelated.com
Forums

sampling a wav file

Started by sharatechno August 18, 2007
Erik de Castro Lopo wrote:
..
> > About a decade ago I suggested to John Eaton that libsndfile be used > to read audio file. Since libsndfile now does FLAC and Ogg/Vorbis (not > publically released yet), it might be time to try this again. >
..
> > Good luck adding FLAC and Ogg/Vorbis support in pure Matlab/Octave > code :-).
Well, it's not such an unlikely thought; not least since matlab or octave may well have been used to develop the dsp for those formats. However, just having full WAVE and AIFF/AIFC PCM support would be very useful. Even AIFF becomes more moot every day, what with Macs now all on Intel, so that AIFF is no longer even the "native" format (and IMO has little else to commend it).
> > I really do thing its time to push for Octave to do audio file > reading via libsndfile whereever libsndfile is available. >
I agree. the question is, how? Ostensibly it would have to be an app-level builtin function, not a m-file. How much format info to return to the caller, and in what way (I would want for example the WAVEX channel mask at the very least so I can process/create various multi-channel files, and PEAK chunk support). There is separate code for au files ("au.m. auload.m etc), suggesting that the Matlab/octave way is to have separate commands for each primary format type. There is therefore an API to be designed that gets as much out of libsndfile as is practicable, into Octave-ese. Ineluctably, you may well be the person best placed to do this; and once done, who knows - maybe the Mathworks will be happy to negotiate a licence for Matlab, just as they do for fftw etc. In the short term, there is still a need to know how to hack wavread and wavwrite (I had to do it just to get endianness handled properly on the PPC Mac), so discussing the perils of soundfile format handling is still an unavoidable activity, sometimes! Richard Dobson
Richard Dobson <richarddobson@blueyonder.co.uk> writes:

> Erik de Castro Lopo wrote: > .. >> About a decade ago I suggested to John Eaton that libsndfile be used >> to read audio file. Since libsndfile now does FLAC and Ogg/Vorbis (not >> publically released yet), it might be time to try this again. >> > .. >> Good luck adding FLAC and Ogg/Vorbis support in pure Matlab/Octave >> code :-). > > Well, it's not such an unlikely thought; not least since matlab or > octave may well have been used to develop the dsp for those > formats. However, just having full WAVE and AIFF/AIFC PCM support > would be very useful. Even AIFF becomes more moot every day, what with > Macs now all on Intel, so that AIFF is no longer even the "native" > format (and IMO has little else to commend it). > >> I really do thing its time to push for Octave to do audio file >> reading via libsndfile whereever libsndfile is available. >> > > > I agree. the question is, how? Ostensibly it would have to be an > app-level builtin function, not a m-file. How much format info to > return to the caller, and in what way (I would want for example the > WAVEX channel mask at the very least so I can process/create various > multi-channel files, and PEAK chunk support). There is separate code > for au files ("au.m. auload.m etc), suggesting that the Matlab/octave > way is to have separate commands for each primary format type. There > is therefore an API to be designed that gets as much out of libsndfile > as is practicable, into Octave-ese. Ineluctably, you may well be the > person best placed to do this; and once done, who knows - maybe the > Mathworks will be happy to negotiate a licence for Matlab, just as > they do for fftw etc. > > In the short term, there is still a need to know how to hack wavread > and wavwrite (I had to do it just to get endianness handled properly > on the PPC Mac), so discussing the perils of soundfile format handling > is still an unavoidable activity, sometimes! > > > Richard Dobson
I hate to say it since the group is so dead, but there is an octave newsgroup: comp.soft-sys.octave --Randy -- % Randy Yates % "She has an IQ of 1001, she has a jumpsuit %% Fuquay-Varina, NC % on, and she's also a telephone." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr
Randy Yates wrote:
..
> > I hate to say it since the group is so dead, but there is an octave newsgroup: > > comp.soft-sys.octave >
It's so dead (or still-born) it doesn't show up at all on my ISP news server, though plenty of com.soft-sys ones are. There is the octave-maintainers list, with whom I see Eric is already in dialogue. I am too much of a novice with octave (and even more so with matlab!), to be in a position to contribute. Can test, of course. Richard Dobson
Richard Dobson wrote:

> It's so dead (or still-born) it doesn't show up at all on my ISP news > server, though plenty of com.soft-sys ones are. There is the > octave-maintainers list, with whom I see Erik is already in dialogue.
Yep. It turns out that it is much easier to build external Octave modules than it used to be when I last looked. That means, that I can probably dump the three .m files I have in the Octave directory of the libsndfile tarball now and replace it with code to generate a binary octave module (.oct) to whatever is necessary. Then I just have to get all the Linux distro package maintainers to make sure to build a sndfile-octave package.
> Can test, of course.
I should have something for you by next week (big hacking day planned for Saturday). Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "All great truths begin as blasphemies." -- George Bernard Shaw
Erik de Castro Lopo <erikd@mega-nerd.com> writes:

> Richard Dobson wrote: > >> It's so dead (or still-born) it doesn't show up at all on my ISP news >> server, though plenty of com.soft-sys ones are. There is the >> octave-maintainers list, with whom I see Erik is already in dialogue. > > Yep. It turns out that it is much easier to build external Octave > modules than it used to be when I last looked. > > That means, that I can probably dump the three .m files I have in > the Octave directory of the libsndfile tarball now and replace it > with code to generate a binary octave module (.oct) to whatever > is necessary. > > Then I just have to get all the Linux distro package maintainers to > make sure to build a sndfile-octave package. > >> Can test, of course. > > I should have something for you by next week (big hacking day planned > for Saturday). > > Erik
Thank you for your contributions, Eric. I'm a heavy user of octave. -- % Randy Yates % "My Shangri-la has gone away, fading like %% Fuquay-Varina, NC % the Beatles on 'Hey Jude'" %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Shangri-La', *A New World Record*, ELO http://home.earthlink.net/~yatescr
Erik de Castro Lopo wrote:
..
> >>Can test, of course. > > > I should have something for you by next week (big hacking day planned > for Saturday). >
No urgency here - I am at ICMC Copenhagen all next week anyway. Anyone on this list likely to be there? Richard Dobson