Re: Creating an audio
- To: mathgroup at smc.vnet.net
- Subject: [mg118658] Re: Creating an audio
- From: Heike Gramberg <heike.gramberg at gmail.com>
- Date: Fri, 6 May 2011 07:23:07 -0400 (EDT)
I guess you could do something like sample = Import["sound.aiff", "SampledSoundList"]; duration = N[Max[Length /@ sample[[1]]]/sample[[-1]]]; times = RandomReal[1, 8] + Range[8]; track = Sound[ Sound[sound, #] & /@ Transpose[{times, times + duration}]] Export["track.aiff", track]; Here, duration is the length of the sample you want to repeat and times is a list of times at which you want to play the sample. Heike. On 5 May 2011, at 00:49, BoLe wrote: > Is is possible to generate and export an audio consisting of silence > and discretely time-positioned instances of the same sound (short, .1- > second). Something like: > > -----x------x-----x--x------x-------x----x-----x---- > > x = Import["sound.aif"] > > I tried Play (where I generated x, unsatisfactorily really), but > wasn't successful. > > I already have the times x would be placed at, in Mathematica where I > also did everything else (solving my system, animating), and it would > be conveniently to create the audio from there too, and then adding it > to the animation movie with QuickTime. >