Search the web
Sign In
New User? Sign Up
jsyn · JSyn discussions and tech support. Java audio synthesis API.
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
WAV file output   Message List  
Reply | Forward Message #226 of 2975 |
Hello,

I have been asked how to capture output to a WAV file. You can use the
new WAVFileWriter class for that. Please see the attached file for an
example. The attached file is an improved version of
"JSynExamples\TJ_NonRealTime.java". I am now using a
BufferedOutputStream which speeds up the file I/O tremendously.

Here are some relevant excerpts from the example file.

// create objects needed to write a WAV file
RandomAccessFile rfile = new RandomAccessFile( "mysong.wav", "rw" );
wavWriter = new WAVFileWriter( rfile );
outStream = new BufferedOutputStream( wavWriter );

---------
// write header for WAV file
wavWriter.writeHeader( NUM_REC_CHANNELS, (int) FRAME_RATE );

----------
// Create a recorder that will continuously record its input.
recorder = new StreamRecorder( outStream, FRAMES_PER_BUFFER, 4,
NUM_REC_CHANNELS );
myOsc.output.connect( recorder.input );

----------
// Go back to the beginning of the random access file and
// update the WAV file chunk sizes based on final recorded size.
outStream.flush();
wavWriter.fixSizes();
outStream.close();

--
Phil Burk
http://www.softsynth.com

Tue Sep 26, 2000 3:57 pm

philburk@...
Send Email Send Email

Attachment
TJ_NonRealTime.java
Type:
application/x-unknown-content-type-java_auto_file
Forward
Message #226 of 2975 |
Expand Messages Author Sort by Date

Hello, I have been asked how to capture output to a WAV file. You can use the new WAVFileWriter class for that. Please see the attached file for an example....
Phil Burk
philburk@...
Send Email
Sep 26, 2000
3:58 pm

Thanks, I tried a real-time version (which finally worked ok) but noticed that the following does NOT work: recorder.start(Synth.getTickCount()); // record...
Nick Didkovsky
drnerve@...
Send Email
Oct 1, 2000
5:21 pm

Hello, ... The recorder.stop(time) method stops the thread which is gathering audio data. If you are doing real-time recording, you cannot post a stop() in the...
Phil Burk
philburk@...
Send Email
Oct 1, 2000
5:36 pm

... Good idea. Mostly though, I'll really be punching a Button to start and stop recording. Nick...
Nick Didkovsky
drnerve@...
Send Email
Oct 1, 2000
5:44 pm

hello all - i've now fixed my audioserve applet to work with the latest plug inand put it up: http://www.yeeking.freewire.co.uk/html/audioserve/intro.html will...
Matt Yee-King
yeeking@...
Send Email
Oct 11, 2000
9:31 pm

Hello Matt, Wow. This is a great Applet! I'm glad you got past the JSyn V14.1 API changes. Sorry again for the code-breakers. I wasn't getting much variation...
Phil Burk
philburk@...
Send Email
Oct 15, 2000
1:19 pm

Went though a couple of generations and got to a pretty disturbing looping noise thingy. Uploaded it. Pretty fun! There was nothing displayed in my circuit...
Nick Didkovsky
drnerve@...
Send Email
Oct 15, 2000
3:10 pm

...and as an extra bonus, this sound/sleep cycle is still continuing on my PC even after quitting the applet and quitting Netscape Communicator! (although...
Nick Didkovsky
drnerve@...
Send Email
Oct 15, 2000
3:14 pm

glad you got some weird sounds! the upload system runs in a thread in the background. every 15 secs it connects to the server and grabs a new sound and uploads...
Matt Yee-King
yeeking@...
Send Email
Oct 16, 2000
7:39 pm

Matt, I'm still having a great time with your AudioServe. I'm really surprised at the variety of sounds that come up. Reminds me of the Cambrian explosion....
Phil Burk
philburk@...
Send Email
Oct 17, 2000
7:24 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help