PDA

View Full Version : sound file duration



jignesh142
11-17-2012, 02:45 AM
we know that we can play the sound via sndplaysound api, but is it possible to control its duration?

for example i want to play one sound file for 2 sec continuously as if the original file is of 2 sec in one situation and to play the same file for 4 sec continuously in some different situation, is it possible?

xltrader100
11-23-2012, 11:35 AM
You don't say what these sound files contain, but it's probably not speech or else different durations wouldn't make sense, so I'm assuming these are sound effects like alert sounds. If this is the case then there's a kind of brute force method you could use by opening the sound in a sound editor like Audacity and making multiple versions of different lengths, and then just call the length of the clip that suits each situation.