de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Sound not stopping properly
PostPosted: Mon Aug 10, 2020 4:29 am 
Offline
Addict
I'm working on creating an estim based script and I've been running into a problem where a random piece of audio, about a 1 second chunk will continue to repeat over and over again even after issuing a playBackgroundSound(null);

Basically my script is presenting a text input, then compares the text that was typed with the input it is expecting and if they don't match or the person is too slow to give a response, it will play one type of audio file. If it is correct, it will play a different audio file.

Basically like this, my actual text and filenames are different, I've changed things here to not spoil what I'm trying to do, although it's a bit predictable anyway.
Code:
if (expectedinput==typed) {setImage("example/example.jpg"); playBackgroundSound(null); playBackgroundSound("StimPack/pleasure/"+(110+getRandom(49))+".mp3"); text="Insert words here"; } else {setImage("example/scold123.jpg"); text="Wrong"; playBackgroundSound("StimPack/pain/ouchfile.mp3"); }
   if (end-start>timelimit) {text=text+", your response is too slow, pain time for you";}
   playBackgroundSound(null); playBackgroundSound("StimPack/pain/ouchfile.mp3"); }


What confuses me is I have played all of the rest of the estim based scripts here haven't ended up with a 'hanging chunk' of sound but it seems it keeps repeating the same 1 second chunk again and again, it doesn't stop if I restart the script or even start a different script. It seems to continue until I completely close Sexscripts. Since this is supposed to mostly be a pleasurable estim script, it gets a little rough when the sounds bite that keeps repeating combines with the next file that plays. Is there anything I'm missing with my code? It seems to work for maybe 50 different start/stops of different audio files before I run into the problem and all of the audio files are 20 seconds long.


Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Mon Aug 10, 2020 10:41 am 
Online
Veteran
User avatar
I have come across this glitch too occasionally. I have some scripts that overlay sounds, i.e. run an audio file, add more audio files, stop the audio files with a play "null" etc. Most of the time this works OK, but sometimes I get this lingering sound play like you describe, even after I quit SexScripts. I have to kill SexScripts in task manager to get rid of it in this case.

Not sure if this is a SexScripts issue, down to how I'm juggliing audio files, or something underlying.

Note I am on an older version of SexScripts (October 2016) due to a properties file glitch I mentioned in another glitch thread, Windows 10 and Java runtime 1.8.0_151-b12


Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Mon Aug 10, 2020 8:45 pm 
Offline
Veteran
I try to make the sence of your code and made this:
Code:
String expectedinput = "x"
String typed
String text = ""
int timelimit = 3
int start = getTime()
typed = getString("Type:", "")
playBackgroundSound(null)
if (getTime() - start > timelimit) {
    // too slow
    text = text + ", your response is too slow, pain time for you"
    playBackgroundSound(null)
    playBackgroundSound("StimPack/pain/ouchfile.mp3")
} else {
    if (expectedinput == typed) {
        // correct input
        text = "Insert words here"
        playBackgroundSound("StimPack/pleasure/" + (110 + getRandom(49)) + ".mp3")
    } else {
        // wrong input
        text = "Wrong"
        playBackgroundSound("StimPack/pain/ouchfile.mp3")
    }
}
wait(5) //TODO wait till played long enough?
playBackgroundSound(null)
show(text)

Does this work better?

Little tip: Write one command in one line, to make it easy to read. Don't use ;.


Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Mon Aug 10, 2020 8:59 pm 
Offline
Addict
I appreciate how to write the code to make more sense over how it works.
I'm not having trouble with the code working or not working, it performs the function. It's just after a certain amount of time running the script after a certain number of audio files it will not stop playing a fragment of the audio repeatedly. Something get 'stuck'. Just like arthurb mentioned, it doesn't stop until the actual java task is ended in task manager either by Sexscripts application actually closing normally and terminating itself or the task getting a kill issued.


Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Wed Aug 12, 2020 2:06 pm 
Offline
Veteran
I had that "stuck" audio only sometimes when reloading a script too quick. It play once only till the end.
Maybe you can put some more playBackgroundSound(null) with short wait(0.?) before in the script?


Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Wed Aug 12, 2020 8:07 pm 
Offline
Addict
I don't know if I fixed the issue, or if it just didn't occur in the 20 minute time window that I tested but I added a wait(1) after the playBackgroundSound(null) so there was a 1 second gap before it changes files and it seems to not be happening now. Perhaps something in java with sound handling needs a moment to fully stop before triggering the next sound run. I'll play with this more and see if it resolves the issue.

I'm actually thinking I'd rather not have the files change every 10-15 seconds because it feels more interrupted when it changes feeling and the 1 second gap isn't ideal. I'm thinking I'll start using 2-5 minute pleasure estim files if the filesize is appropriate and only change the file if pain is in the cards such as the person makes a mistake, or perhaps if they reach the end of a file, I will create a scenario involving a special different pain file(s) to keep things interesting. :twisted: I'm also realizing I probably need to put breaks in for making sure estim connections remain clean and electrode gel can be added, along with an option to have a new volume calibration to keep the volume high as the player gets used to the signal.


Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Wed Aug 12, 2020 8:42 pm 
Offline
Site Admin
User avatar
I'll try to inverstigate, but it's hard to check as the bug is quite random. Perhaps I'll have some idea.

What are the versions of Java and OS please ?


Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Thu Aug 13, 2020 2:54 am 
Offline
Addict
"What are the versions of Java and OS please ?"

Windows 7 Build 7601 service pack 1
Java 8 update 251 (build 1.8.0_251-b08)

Hopefully not muddying up the waters but I just got prompted to update Java last week and the last time I saw the problem was with the version I was using before. So now the changes would be this latest version and a wait(1) that I've added.

Previously my code would play audio as BackgroundSound for a 20 second file and almost always stop it while it was playing(because if the player took longer it would result in a punishment) by having it play (null), then on the next line of code start the next sound file. It's very possible that mashing together sound commands caused the problem, perhaps I'll continue to test with the 1 second wait between sound commands and see if this is a workaround that does the trick.


Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Sat Aug 22, 2020 5:21 am 
Offline
Addict
Using that Java version posted above, the issue continues to happen. I thought it wasn't doing this with a wait(1) added in but it seems it still happens. I'm not sure why but I was able to test it for about 45 minutes without any issues one day and then the next day it would happen within the first few minutes and would continue even after closing Sexscripts until I killed its underlying Java process in task manager, which happened to be using something like 600 megs of RAM after running for about 5 minutes?!? I'll have to pay more attention to the memory usage. I tried to paste in the same start and stop (playing null) commands into a completely different script in a bunch of different places (Lines from 2015 03 31) just to see if something else was tripping it and I was able to reproduce it in under 5 minutes 3 times in a row. The next day it was fine until about 30 minutes later when I got bored of testing.

Code written like this which is the same as my original post but added a wait to make sure there wasn't some sound subsystem still doing something in the background but the wait doesn't seem to have fixed it.

playBackgroundSound(null)
wait(1)
playBackgroundSound("StimPack/subfolder/stimfile.mp3")


Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Sat Jun 11, 2022 4:50 pm 
Offline
Shy
Sorry for reviving this topic.

A possible solution in 'Script.java', for avoiding living background sound threads...


Attachments:
possible_fix_background_sound_not_stopping.diff.txt [1.97 KiB]
Downloaded 231 times
Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Sun Jun 19, 2022 8:34 pm 
Offline
Shy
Attached a better patch and exe.


Attachments:
sexscripts.7z.txt [255.75 KiB]
Downloaded 222 times
possible_fix_background_sound_not_stopping.diff.v2.txt [1.58 KiB]
Downloaded 231 times
Top
 Profile Send private message 
 
 Re: Sound not stopping properly
PostPosted: Wed Jul 20, 2022 4:27 pm 
Offline
Site Admin
User avatar
Thank you, we'll try this


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.