[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GSoC audio callbacks
From: |
Vytautas Jancauskas |
Subject: |
Re: GSoC audio callbacks |
Date: |
Sat, 7 Sep 2013 15:58:49 +0300 |
Ok, my bad. I thought sndfile expects the number of frames to read and
write commands, but it turns out it expects a number of "items" to be
read/written. This should be fixed now.
On Mon, Sep 2, 2013 at 9:41 PM, Mike Miller <address@hidden> wrote:
> On Mon, Sep 2, 2013 at 16:58:16 +0300, Vytautas Jancauskas wrote:
>> I only get this problem with ogg files. Can you send me wav or flac
>> files that give bad results? I tried with several different ones and
>> they seem to load fine, stereo or otherwise.
>
> Sure, the following gives me exactly one second of good audio followed
> by one second of corrupted audio in the matrix y.
>
> Fs = 44100;
> t = [0:2*Fs-1]'./Fs;
> x = cos (2*pi*440*t);
> audiowrite ("onechan.wav", x, Fs);
> system ("sndfile-interleave onechan.wav onechan.wav -o combined.wav");
> y = audioread ("combined.wav");
> p = audioplayer (y, Fs);
> play (p);
> plot (y);
> axis ([0 2*Fs -2 2]);
>
> Stereo files written with audiowrite also contain only half the number
> of samples that are in the original matrix.
>
> --
> mike
--
"Cheshire-Puss," she began, "would you tell me, please,
which way I ought to go from here?"
"That depends a good deal on where you want to get to," said the Cat.
"I don't care much where--" said Alice.
"Then it doesn't matter which way you go," said the Cat.