I have a Designer project with an mp3 as background music, loaded in the first page with id 1. I want to fade out the music in the last page, were I have this loop as code in the page:
but when displaying the last page I get the message "Could not find sample 1!" (or "Could not find music 1!" If SetMusicVolume is used). I tried loadin the mp3 as sample or stream and same result.
You need to assign an ID for the MP3 in the sound dialog, e.g. "MYMUSIC". Then you can access this music by using the %@MYMUSIC wildcard, e.g. like this:
airsoftsoftwair wrote:You need to assign an ID for the MP3 in the sound dialog, e.g. "MYMUSIC". Then you can access this music by using the %@MYMUSIC wildcard, e.g. like this:
...
Note the Wait() call. If you don't use a short delay, the fade will be so fast that it won't be noticeable and the music will just stop right away.
Thanks! Working now. Since code executes before the the page or object I had to finish with a last black page with corssfade transition, nice to end videos of a presentation. But music contimues playing until the presentation is closed so just in case I added StopMusic at the end. This is the final code: