Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adding a blank audio track



Hi!

I am creating a video from png images.  Which I can do successfully!

My problem is that Im trying to add a blank audio track to it. I am trying to do this because if I add the movie file into a video editor, it gives me an error and will not open- something like invalid audio track or no audio track available.

NOw I picked up the Quicktime for Java book and looked up audio tracks, and found a decent example. But I cannot seem to get rid of the audio sound entirely. Always at the very beginning of the video there is one millisecond of high volumed static.

Here is what I am doing with the audio stuff... thanks for reading!

----------

//blank audio value - does this work right?
byte[] emptySound = new byte[44100*2];
 for (int i=0; i<44100 * 2;i++){
	  emptySound[i] = (byte) 0x00;
 }

...later...

//add audio track
Track trkSoundTrack = movMovie.addTrack(0,0,1);
Media medSoundMedia = new SoundMedia(trkSoundTrack, movMovie.getTimeScale());//1);
medSoundMedia.beginEdits();


//build sound description
int format = QTUtils.toOSType("NONE");
SoundDescription sdSoundDesc = new SoundDescription(format);
sdSoundDesc.setNumberOfChannels(1);
 sdSoundDesc.setSampleSize(16);
 sdSoundDesc.setSampleRate(44100);


for (int i=1; i<= iTotalImages; i++) { //add image to video track and...

//add audio to frame
QTHandle qthHandle = new QTHandle(emptySound);
medSoundMedia.setTimeScale(m_iFramesPerSecond);
medSoundMedia.addSample(qthHandle,
			0,
		qthHandle.getSize(),
			1,
		sdSoundDesc,
			1,      //44100,
		        	sampleFlags);

} //end for

medSoundMedia.endEdits();

trkSoundTrack.insertMedia(0,0,medSoundMedia.getDuration(), 1);


_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-java mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-java/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.