|
Page 1 of 1
|
[ 6 posts ] |
|
Sound file won't play when passed as variable
| Author |
Message |
|
Philipp
Rookie
Joined: Tue Nov 22, 2011 10:45 am Posts: 12
|
 Sound file won't play when passed as variable
I want to play an *.rso sound, and I want my program to dynamically concatenate the sound file name. However, when passing it to the PlaySoundFile() function, it doesn't play a sound -- even when the same PlaySoundFile() will work if I manually include the string value! I've tried to break it down to below code (it's not exactly what I'm using but should illustrate the issue in the minimal form): (This even happens when I add a dummy "PlaySoundFile("sound/1.rso");" to the beginning of the program to make sure RobotC adds the sound file... what's a better way to do that, by the way?) Can anybody help? Thanks!
|
| Fri Nov 25, 2011 12:32 pm |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2865 Location: Rotterdam, The Netherlands
|
 Re: Sound file won't play when passed as variable
You need to change the path in the Preferences. Go to Preferences->NXT Directories and modify the NXT System Resources Files Directory.
- Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Fri Nov 25, 2011 5:37 pm |
|
 |
|
Philipp
Rookie
Joined: Tue Nov 22, 2011 10:45 am Posts: 12
|
 Re: Sound file won't play when passed as variable
Xander, this is what I did at the beginning. And note that the sounds play when I use the parameter "manually" (write a string value). But when passing the parameter as variable, it won't work anymore.
|
| Fri Nov 25, 2011 5:46 pm |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2865 Location: Rotterdam, The Netherlands
|
 Re: Sound file won't play when passed as variable
That is very odd and sounds like a bug to me. Send a mail to support@robotc.net and let them know  - Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Fri Nov 25, 2011 5:57 pm |
|
 |
|
Philipp
Rookie
Joined: Tue Nov 22, 2011 10:45 am Posts: 12
|
 Re: Sound file won't play when passed as variable
Thanks Xander. In the meantime, I'm switching to Frequencies via PlayTone...
|
| Fri Nov 25, 2011 6:01 pm |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2865 Location: Rotterdam, The Netherlands
|
 Re: Sound file won't play when passed as variable
Oh very 8-bit old school 
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Fri Nov 25, 2011 6:04 pm |
|
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 3 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
|
|