It seems Alert.playSound() works only if it is called while processing the last bar on the chart. For example, there are two testing scripting, one plays a sound at the barindex == -5 while another one plays a sound at bar 0.
if ( getCurrentBarIndex() == -5 && getBarState() == BARSTATE_NEWBAR ) {
Alert.playSound("Dong.wav");
}
if ( getCurrentBarIndex() == 0 && getBarState() == BARSTATE_NEWBAR ) {
Alert.playSound("Dong.wav");
}
No sound is heard while running The first testing script although the function is called, and the second script works normally.
Is this a designed behavior or it is an implementation bug of Alert.playSound()?
- Clearpicks
if ( getCurrentBarIndex() == -5 && getBarState() == BARSTATE_NEWBAR ) {
Alert.playSound("Dong.wav");
}
if ( getCurrentBarIndex() == 0 && getBarState() == BARSTATE_NEWBAR ) {
Alert.playSound("Dong.wav");
}
No sound is heard while running The first testing script although the function is called, and the second script works normally.
Is this a designed behavior or it is an implementation bug of Alert.playSound()?
- Clearpicks
Comment