|
From: Sergei S. <ser...@ya...> - 2012-12-02 08:27:34
|
----- Original Message ----- > From: Doug Lee <dg...@dl...> > To: Sergei Steshenko <ser...@ya...> > Cc: "sox...@li..." <sox...@li...> > Sent: Sunday, December 2, 2012 10:23 AM > Subject: Re: [SoX-users] endlessly repeating self-built waveform ? > > On Sat, Dec 01, 2012 at 09:40:15PM -0800, Sergei Steshenko wrote: >> ----- Original Message ----- >> > From: Doug Lee <dg...@dl...> >> > To: Sergei Steshenko <ser...@ya...>; > sox...@li... >> > Sent: Sunday, December 2, 2012 7:32 AM >> > >> > On Sat, Dec 01, 2012 at 07:36:31PM -0800, Sergei Steshenko wrote: >> >> Hello, >> >> suppose I've build a sound file (for simplicity, a .wav one) > which >> > contains just one period of a periodic function. >> >> And the shape of that function is according to my needs, i.e. > it's not >> > a shape readily available from 'sox'. >> >> Is there a way to endlessly repeat (infinite loop) playing of > that single >> > period without gaps ? As if 'sox' is that special periodic > function >> > signal generator. >> > >> > I think the `repeat' option is what you want, though whether > it's >> > gapless for real-time use may depend on your hardware, and it's > not >> > infinite: >> > >> > play file.wav repeat 99999 >> > >> > may be gapless on fast hardware, but >> > >> > sox file.wav loop999.wav repeat 999 >> > >> > should be gapless in its creation of loop999.wav. >> >> So, if instead of 1 period I have, say, 100000 periods (several seconds), > and taking into account that modern OSes cache files in RAM, should I expect > rarer gap occurences ? > > I'd say try and see what you get. For a file-to-file (SoX command) > operation, you shouldn't get any gaps at all. For a file-to-audio > (play command) operation, I can only tell you I think the results can > depend on hardware. Others may have more concrete input on that point. > > Results depend on HW anyway - rarely underruns/overruns occur. Since I'm using 'sox' with long buffers, sending buffer to audio device and opening the file again while the audio device is still playing the buffer is what I'm hoping for. Thanks, Sergei. |