How to play a wav content with the bitrate of 256kbps by audio_play?
Hi every one, we provide a wav content with the bitrate of 16kbps for the audio_play to play, it is ok. Now, if the bitrate is another one, for example 256kbps, what shoud we do? Should we change the bitrate of the wav content? Should some one help me?
thanks
I have do some test like this:
I have put the test source codes to the github, every one can git them from : test bite rate for audio play.
My enviroment is: ubuntu 14.04 LTS, ros indigo.
First you should install the audio_common: sudo apt-get install ros-indigo-audio-common
Secondly, open the test_bite_rate_audio_play_server/src/test_bite_rate_audio_play_server.cpp, you will see the two lines codes:
FILE *fp_test = fopen("/home/turtlebot/catkin_ws/src/test_bite_rate_audio_play_server/res/test2.wav", "r"); // this is no sound, it's bite rate is 256kbps
//FILE *fp_test = fopen("/home/turtlebot/catkin_ws/src/test_bite_rate_audio_play_server/res/test1.wav", "r"); // this is ok, the bite rate is 16kbps
you should replace the file path for your local environment. Then build the packages.
Third, open a terminal and run : roscore
the next few new tap, you may be run the source: source /home/turtlebot/catkin_ws/devel/setup.bash
open a new tap and run: rosrun audio_play audio_play audio:=audio_content_publisher
open a new tap and run: rosrun audio_server audio_content_publish_server
open a new tap and run: rosrun test_bite_rate_audio_play_server test_bite_rate_audio_play_server
Then you should hear nothing, or see a message at the final tap terminal: Segmentation fault (core dumped)
Now, do the second test, it is nearly the same as the first test, common the first line and uncommon the second line, like this:
//FILE *fp_test = fopen("/home/turtlebot/catkin_ws/src/test_bite_rate_audio_play_server/res/test2.wav", "r"); // this is no sound, it's bite rate is 256kbps
FILE *fp_test = fopen("/home/turtlebot/catkin_ws/src/test_bite_rate_audio_play_server/res/test1.wav", "r"); // this is ok, the bite rate is 16kbps
when you run the final command, you will hear some sound.
The different of the two test is : the bite rate of wav files is different, one is 16kbps and the other is 256kbps, so some would help me? thanks
Have you tried playing a 256kbps wav file to see if it works?