Author |
Message |
sir honey
Joined: Aug 04, 2006 Posts: 36 Location: NY
|
Posted: Mon Feb 19, 2007 9:08 am Post subject:
Trouble Writing to File. Subject description: my audio files won't open after recording to disk |
 |
|
Hi All,
I'm trying to grab samples from my dac while other chuck programs are running. I run this program:
Code: |
// Jack's record module.
dac => WvOut wave => blackhole;
"/chuck/jackchuck/chucksamples/testing.wav" => wave.wavFilename;
2 => int seconds; //number of seconds to sample (increment to increase file size).
0 => int control;
while ( control < seconds )
{
1::second => now;
control++;
}
|
and actually write a file in the desired location. Everything appears fine until I try to open the file and play it back, and then Quicktime tells me that there is an error opening the file. Same goes for iTunes, LogicPro etc. So what's up with the file? none of the other formats seem to work either (aif, raw etc.)
I can't get the enclosed example rec.ck to do any differently (although my version is so similar, this isn't surprising).
Any help on this? I'm really bummed, 'cause this was the single most exciting this about chucK for me! realtime sampling and manipulation! Help.
Thanks for putting up with my posts,
jack |
|
Back to top
|
|
 |
ge

Joined: Aug 13, 2006 Posts: 108 Location: Palo Alto, CA
|
Posted: Mon Feb 19, 2007 9:38 pm Post subject:
|
 |
|
Hi!
Hmm, interesting. I can't seem to duplicate the bug - I am able to play the file. Are you on OS X? Checking the code, the file seems to be written correctly. What is the file size for your corrupted file?
We'll do what we can to get to the bottom of this! |
|
Back to top
|
|
 |
sir honey
Joined: Aug 04, 2006 Posts: 36 Location: NY
|
Posted: Tue Feb 20, 2007 7:48 am Post subject:
|
 |
|
the file size is 172k. seems right, no?
I'm in OSX 10.3.9 on an old 800mhz G4 powerbook.
I really wish this would work...
thanks for your help, Ge
(I'm a big fan of what you do).
jack |
|
Back to top
|
|
 |
ge

Joined: Aug 13, 2006 Posts: 108 Location: Palo Alto, CA
|
Posted: Wed Feb 21, 2007 10:19 pm Post subject:
|
 |
|
sir honey wrote: | the file size is 172k. seems right, no? |
That seems promising...
Are you using the command line chuck or the miniAudicle? for the miniAudicle, some files won't get closed properly until you quit the miniAudicle.
Also, here is a modified standalone test, try running this by itself, separately in both command line chuck and then miniAudicle (check preferences to see where the file is put):
Code: | // patch
SinOsc s => dac => WvOut wave => blackhole;
440 => s.freq;
.25 => s.gain;
"foo.wav" => wave.wavFilename;
// number of seconds to sample (increment to increase file size).
2 => int seconds;
0 => int control;
// go
while( control < seconds )
{
1::second => now;
control++;
} |
Using this, you should be able to generate a 2 second file of sine.
Quote: | thanks for your help, Ge |
No need to thank. Happy to try!!
Thank you for reporting this! |
|
Back to top
|
|
 |
sir honey
Joined: Aug 04, 2006 Posts: 36 Location: NY
|
Posted: Thu Feb 22, 2007 7:32 am Post subject:
|
 |
|
hey ge,
I'm running command line chuck only, havent even tried using the audicle or mini.
Nope, Same result with your code!
Quicktime, Realplayer, iTunes, Logic Pro... nobody wants to open these files originated in chuck. Has anybody else had this sort of problem before?
I'm about to get a new intel mac, but I'd like not to have to wait until then to use chuck in this fashion. Probably you would agree, too.
Talk to you soon!
jack |
|
Back to top
|
|
 |
spencer

Joined: Aug 16, 2006 Posts: 53 Location: northern california
|
Posted: Thu Feb 22, 2007 1:17 pm Post subject:
|
 |
|
jack,
I was able to reproduce this problem by running 'chuck --loop yourtestfile.ck'. chuck won't automatically close WvOut's until it exits, because without garbage collection its not great at knowing when you are actually done recording to it. you might want to try closing the file manually (and stop recording) with a line like this: after the end of your loop. The string argument there doesn't have any significance but for some reason its required.
spencer |
|
Back to top
|
|
 |
sir honey
Joined: Aug 04, 2006 Posts: 36 Location: NY
|
Posted: Thu Feb 22, 2007 3:42 pm Post subject:
|
 |
|
thanks spencer.
I did try:
at the end of my record program, and that didn't work.
but I hadn't tried appending the ("path/filename.blah") part.
I'll try it soon, and report back.
thanks again.
jack |
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Thu Feb 22, 2007 4:44 pm Post subject:
|
 |
|
sometimes i got this problem also..
and most of the time i changed the format (wav) to AIFF instead..
and it worked -_-"
so it's still quite strange to me. -_-' ..  |
|
Back to top
|
|
 |
sir honey
Joined: Aug 04, 2006 Posts: 36 Location: NY
|
Posted: Thu Feb 22, 2007 5:20 pm Post subject:
|
 |
|
thanks guys,
problem solved. I'm happily chucking and recording my live sessions right now!
jack |
|
Back to top
|
|
 |
|