View unanswered posts | View active topics It is currently Tue Jul 28, 2015 5:50 pm






Reply to topic  [ 4 posts ] 
Using custom soundfiles 
Author Message
Rookie
User avatar

Joined: Wed Jun 04, 2014 4:06 pm
Posts: 30
Location: Margraten, The Netherlands
Post Using custom soundfiles
Hi there,

I'm trying to use custom soundfiles from within RobotC. I converted a WAV-file with WAV2RSO and renamed the file-extention to RSF (I found this trick somewhere on Internet). This works fine from within EV3-software and I can play this custom soundfile directly from the EV3-brick. So the soundfile seems to be OK.

But when using this soundfile in RobotC I hear no sound and I wonder what I'm doing wrong. Here's what I've done: in the end I stored the custom soundfile in the same directory as all the original EV3 soundfiles in de RobotC environment (directory Soundfiles in EV3 System Files). Furthermore I manually uploaded the soundfile to the EV3-brick, just to be sure it's on the brick. I wrote the following testprogram:

Code:
// Custom soundfile: NoBeacon.rsf.
// File stored in directory Sounds of EV3 Systems files of RobotC (just like original EV3 soundfiles)
// Furthermore manually uploaded custom soundfile to EV3 brick in same directory as program.

void checkSoundFile(const char *pFileName)
{
   bool bExists;

   bExists = bEv3FileExists(pFileName);
   while (!bSoundQueueAvailable)
   {}
   playSoundFile(pFileName);
   return;
}

task main()
{
   setSoundVolume(30);
   checkSoundFile("One");         // Original EV3 soundfile (one.rsf), works fine
   sleep(1000);
   checkSoundFile("NoBeacon");      // Custom soundfile (NoBeacon.rsf), no sound, bExists=false
   sleep(3000);
   checkSoundFile("NoBeacon.rsf");   // Same custom soundfile, no sound, bExists=true
   sleep(3000);
}


Result when running this program:
- Soundfile One.rsf is played successfully.
- Custom soundfile is not. At the first call the soundfile is not found (bExists = false), at the second call the custom soundfile is found on the EV3-brick (bExists = true), but still there's no sound.

Anyone can help me?


Sun Nov 02, 2014 10:24 am
Profile
Rookie
User avatar

Joined: Wed Jun 04, 2014 4:06 pm
Posts: 30
Location: Margraten, The Netherlands
Post Re: Using custom soundfiles
Solution was as simple as is (as it often is :D ). When you download your own soundfile *.rsf to the EV3-brick, it's placed in the directory RC. In order for the program to find this file, you have to specify the full path:

Code:
task main()
{
   setSoundVolume(30);
   checkSoundFile("/home/root/lms2012/prjs/rc/No_Beacon");      // Custom soundfile: No_Beacon.rsf
   sleep(1000);
}


Now it works fine.


Thu Jul 16, 2015 4:42 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3569
Location: Rotterdam, The Netherlands
Post Re: Using custom soundfiles
That sounds like something that could use a little improvement, I'll put it on the list :)

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Jul 17, 2015 2:40 am
Profile WWW
Rookie

Joined: Wed Dec 03, 2014 5:57 pm
Posts: 14
Post Re: Using custom soundfiles
Hi,
Thanks for posting the idea of using the full pathname. This solved my problem posted
in the topic "Downloading Sound Files". Thanks again.
Howard


Fri Jul 17, 2015 11:01 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 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.
Designed by ST Software for PTF.