how to play a sound for 5 seconds
By : Logan Albright
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , i want to play a sound for 5 seconds but the code which i am using is playing the sound infinitely. , Try to remove this line from your code code :
player.setLooping(true);
|
Play sound in Chronometer after 30 seconds has passed
By : Ike Gentz
Date : March 29 2020, 07:55 AM
help you fix your problem You need to implement a OnChronometerTickListener on your chronometer. Here is an example: code :
chronometer.setOnChronometerTickListener(new OnChronometerTickListener()
{
@Override
public void onChronometerTick(Chronometer chronometer)
{
}
});
|
How to play a beep sound when time is less than 10 seconds
By : user3152774
Date : March 29 2020, 07:55 AM
I wish this help you Thank you guys, the problem was solved! My browser was blocking websites from playing sounds. The code is working now with little modification: code :
**// Not working!**
if (--timer < 10) {
var audio = new Audio('beep.mp3');
audio.play();
}
**// working!**
if (timer < 10) {
var audio = new Audio('beep.mp3');
audio.play();
}
|
Play sound every x seconds if selectbox is?
By : danovalo
Date : March 29 2020, 07:55 AM
should help you out I want to play a sound if a selectbox value = 'x': , Change data-time value number in minutes: code :
var loop;
$('#additiveSport').on('change', function() {
var time = parseInt($(this).find(":selected").data("time")) * 1000;
if ( this.value == 'Heimtrainer')
{
loop = setInterval(function(){$.playSound("http://www.noiseaddicts.com/samples_1w72b820/3724.mp3")}, time);
}
else
{
clearInterval(loop);
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src='https://cdn.rawgit.com/admsev/jquery-play-sound/master/jquery.playSound.js'></script>
<select name="additiveSport" id="additiveSport" class="form-control is-invalid" aria-describedby="additiveSport-error" aria-invalid="true">
<option value="-" data-time="2">Bitte auswählen...</option>
<option value="Fahrrad" data-time="1">Fahrrad</option>
<option value="Heimtrainer" data-time="1">Heimtrainer</option>
<option value="Spazieren" data-time="3">Spazieren</option>
</select>
|
How to play a sound every 2 seconds?
By : JoshMoyer
Date : March 29 2020, 07:55 AM
it fixes the issue You can use a flash.utils.Timer object to fire TimerEvents at whatever interval you like. Another approach could be to add a 2 second gap to your mp3 and play it continuously.
|