Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
D&D 2024 has arrived! Pre-order the new core rulebooks now and get an exclusive pre-order bonus for free!
Create a free account

Sound API always reports playing?

1443568301

Edited 1443570121
DXWarlock
Sheet Author
API Scripter
Maybe Im doing it wrong and missing what I got..but it seems to always report 'playing' even if its not. Playlist says: Now Playing Nothing, currently. But with this it always returns 'true' and 'playing' PlaySound('Roll 20 Crit Hit', 9000); function PlaySound(trackname, time) {     var track = findObjs({type: 'jukeboxtrack', title: trackname})[0];     log(track);     if(track && track.get('playing') === true) {         log('Already playing');         track.set('playing', false);     } else if(track) {         log("playing");         track.set('playing', true);         setTimeout(function() {track.set('playing', false);}, time);     } else {         log('ERROR');     } } This is the debug return: {"_type":"jukeboxtrack","_id":"-K-0B6l3ZTdJWd4o7LCV","playing":true,"softstop":true,"title":"Roll 20 Crit Hit","loop":false,"volume":100} "Already playing" Any ideas? I cannot get sounds to play at all. it seemed to be working over the weekend, but now nothing.
1443578520
The Aaron
Pro
API Scripter
Hmm.. I haven't had a chance to play with it yet, but my debugging seems to indicate the state is correctly reflected when specified through the UI.  Possibly there is an issue with the API though.  If you start/stop the track via the UI, does the script then log playing instead?