Mailing Lists: Apple Mailing Lists

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

Re: adding a blank audio track



Just worth checking.  Do you have the same problem if you record a 1 sec silent wav file and then add it for the duration of your movie?  That is, instead of writing the silence bytes yourself, use a pre-recorded, but short, WAV file. 

I also notice you're setting the volume on your audio track to 1f.  Why not 0f?

Cheers,

Alex

A O <email@hidden> wrote:
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

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

 _______________________________________________
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

References: 
 >adding a blank audio track (From: "A O" <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.