Code Monkey home page Code Monkey logo

audio_common's People

Contributors

708yamaguchi avatar aginika avatar ahendrix avatar bennyre avatar dlu avatar felixduvallet avatar furushchev avatar garaemon avatar gerardcanal avatar heuristicus avatar hgaiser avatar iory avatar itohdak avatar k-okada avatar kanazawanaoaki avatar knorth55 avatar lucasw avatar mikaelarguedas avatar mvollrath avatar naveedhd avatar neowizard avatar peci1 avatar piyushk avatar prarobo avatar rokusottervanger avatar sktometometo avatar stonier avatar tkmtnt7000 avatar trainman419 avatar v4hn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audio_common's Issues

sound_play crashes on PR2 (ros ticket #2)

Output:
$ rosrun sound_play soundplay_node.py
Traceback (most recent call last):
File "/opt/ros/source/audio_common/sound_play/scripts/soundplay_node.py", line 49, in
from diagnostic_msgs.msg import DiagnosticStatus, KeyValue, DiagnosticArray
ImportError: No module named diagnostic_msgs.msg

It looks like this is due to a missing dependency in the manifest.xml file; please look at and fix.

trac data:

audio_play doesn't continue playing when stream restarts

Here's my test case: I launch audio_play and audio_capture in separate terminals. All works fine but when I terminate audio_capture and restart it, just silence is delivered.

The same problem occurs when playing the /audio topic from a bag file.
The problem doesn't occur when I use a file sink instead the alsasink.

The gstreamer log says nothing except

0:02:59.233072514 17796 0x7faecc04e120 WARN                   pulse pulsesink.c:651:gst_pulsering_stream_underflow_cb:<sink-actual-sink-pulse> Got underflow

when I terminate audio_capture. When I restart audio_capture the log says nothing on the info level. On the debug level it is still very verbose. I can't see a difference between the debug logs when it's working and when not. In the debug log there are messages from the source, the decoder, the converter and the sink.

The onAudio callback gets called as it should be and g_signal_emit_by_name returns successful.
I also checked that the pipeline is in PLAYING state all the time.

I checked this problem on two different machines with Ubuntu 14.04 and Indigo.

As this doesn't appear with a file sink I suspect either the decoder, converter or the sink. Does anyone have an idea how to fix this or how to further debug this?

Edit: The gstreamer graph is identical in both cases. I plotted them with GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS().

soundplay_node no longer works on Hydro (v0.2.5)

I get the following error trying to run the code:

bwi@calculon:~$ rosrun sound_play soundplay_node.py 
Traceback (most recent call last):
  File "/opt/ros/hydro/lib/sound_play/soundplay_node.py", line 368, in <module>
    soundplay()
  File "/opt/ros/hydro/lib/sound_play/soundplay_node.py", line 304, in __init__
    rootdir = os.path.join(roslib.packages.get_pkg_dir('sound_play'),'sounds')
NameError: global name 'roslib' is not defined

I believe this change is responsible:
f5a1355#diff-c4ecd77ae058b18c549f3b287bd340b4R304

As far as I can tell, roslib is never imported, and that seems to be the only error. I'll submit a PR.

capture timestamped audio (ros ticket #20)

I have added a new node (and msg) that enables the ability to capture timestamped audio (in raw). This would be useful for precisely determining when captured sounds happen, such as the click from an SLR camera, and then they can be synchronised with other sensors.

Here is a patch in case this can be added to the project.

trac data:

libsoundplay ImportError

After this steps:

  1. clone audio_common into my catkin repo
  2. catkin_make
  3. sourcing setup.bash
  4. rosrun sound_play say.py
    Error message:
    "from sound_play.libsoundplay import SoundClient
    ImportError: No module named libsoundplay"
    The reason is libsoundplay.py not in PYTHONPATH.
    When I copy it to my devel/lib/python2.7/dist-packages/sound_play all works fine.

How to use audio_capture for wave not mp3?

I have try to use wav file for out put, then i download the source code of audio_capture, and change the code : ros::param::paramstd::string("~format", _format, "mp3"); to ros::param::paramstd::string("~format", _format, "wave"); when i run the project, it get an error: [ERROR] [1466752230.167599944]: Unsupported media type. i try to look for more information, it's return is "false" from the code : link_ok = gst_element_link_many( _source, _sink, NULL);

Could some one kindly help me? thanks.

error on soundplay_node

Hi,
whenever I try to play a sound or say text, the sound node generates this error and introduces a delay in playing:

[v01d@kanji ~]$ rosrun sound_play soundplay_node.py
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
[INFO] [WallTime: 1397402403.034453] sound_play node is ready to play sound
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed

sound_play and test do not work on PR2 (ros ticket #5)

I'm seeing this backtrace out of soundplay_node.py when trying to run the sound test on a PR2 on electric with the latest release of the sound_play stack.

[ERROR] [WallTime: 1324328714.747158] Exception in callback: playbin
[INFO] [WallTime: 1324328714.747907] Traceback (most recent call last):
File "/opt/ros/electric/stacks/audio_common/sound_play/scripts/soundplay_node.py", line 216, in callback
self.voicesounds[data.arg] = soundtype(wavfilename)
File "/opt/ros/electric/stacks/audio_common/sound_play/scripts/soundplay_node.py", line 75, in init
self.sound = gst.element_factory_make("playbin","player")
ElementNotFoundError: playbin

It looks like this goes back to this changeset: https://kforge.ros.org/audiocommon/audio_common/file/4bce526be63f/sound_play/scripts/soundplay_node.py

Please test on the PR2 before releasing, so that we don't have any more surprises like this.

This is blocking a final version of the PR2 installer and shipment of PR2s.

trac data:

format of audio_common_msgs/AudioData (ros ticket #1)

Could you please describe the format of the data field in the messages created by an audio_capture node (audio_common_msgs/AudioData)?

From what I could tell, the output is written from a gst.Buffer with entries of type signed long. However, this is strange because the number of bytes of the data field is sometimes odd, when is should be a multiple of 4 (the size of a long).

In the end, I need to obtain the audio data with respect to time from rosbags of the output of an audio_capture node.

trac data:

indigo release

Please release this module for the upcoming ros distribution indigo.

It compiles/runs fine with indigo, although I would propose to rename sound_play's "test" binary. This target name officially reserved by cmake and cmake warns about it.

Sound.repeat() does not repeat the sound

(I came across this while working on #64, personally I have no use for this functionality but I figured it would be good to report).

The SoundClient's repeat() method does not appear to actually repeat the sound (instead it just plays it one time).

MWE:

def play_repeat():
    soundhandle = SoundClient()
    rospy.sleep(0.5)

    sound_beep = soundhandle.waveSound("say-beep.wav")
    sound_beep.play()
    rospy.sleep(1)
    sound_beep.repeat()
    rospy.sleep(5)

The first call plays the sound once, as expected.

The second call is expected to play the sound "repeatedly until stop() is called," but it also only plays it one time.

Tested on Ubuntu 14.04 with ros indigo.

No Jade package

There is currently no Jade Debian package yet. It would be great if we could simply bump the gbp release and rollout the nice new package. Right now, I am compiling it from scratch to use it with Jade.

Make an Indigo Branch

And then I will fix this:

/opt/ros/indigo/lib/python2.7/dist-packages/sound_play/libsoundplay.py:89: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  self.pub = rospy.Publisher('robotsound', SoundRequest)

Building stack for Rasberry Pi

We faced troubles during building this stack for the Raspberry Pi.
During catkin_make an error on the dependencies in CMakeLists.txt occurs.
We could solve this issue by removing line 18 in CMakeLists.txt (add_dependencies(audio_play, ........).
Is this a bug?

How to set the versin of robotsound in sound_play?

Hi,
Some codes to call sound_play to play a wav file that i have writen are:
sound_play::SoundClient sc;
const char *str2 = "/home/turtlebot/Desktop/ros/Welcome.wav";
sc.startWave(str2);

then run the codes, the error is :
[ERROR] [1469534489.657482555]: Client [/sound_play] wants topic /robotsound to have datatype/md5sum [sound_play/SoundRequest/f194e75f1c3bf7a3e1e8b16bc9ef7c2a], but our version has [sound_play/SoundRequest/d098ce4a040686259137ece23a625167]. Dropping connection.
what should i do? How to change the version of robotsound?

Publisher declaration in libspundplay.py uses deprecated format in the Indigo release as well.

/opt/ros/indigo/lib/python2.7/dist-packages/sound_play/libsoundplay.py:89: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  self.pub = rospy.Publisher('robotsound', SoundRequest)

According to ROS Indigo - the line should be:

self.pub = rospy.Publisher('robotsound', SoundRequest, queue_size=1)

memory leak in audio_capture (ros ticket #18)

I found a memory leak when not unrefing the buffer in the onNewBuffer() callback

here is a patch:

HG changeset patch

User Mike Bosse [email protected]

Date 2012-10-30 13:16:16 +1000

Node ID 9ef7c8bd5fe24a635afc3668b5adfd90d658ceba

Parent 41867e966e88da6df23521e150724be6901e0197

fixed memory leak

diff --git a/audio_capture/src/audio_capture.cpp b/audio_capture/src/audio_capture.cpp
--- a/audio_capture/src/audio_capture.cpp
+++ b/audio_capture/src/audio_capture.cpp
@@ -92,6 +92,8 @@

     server->publish(msg);
  •   gst_buffer_unref(buffer);
    
    • return GST_FLOW_OK;
      }

trac data:

soundplay_node.py crashes with "Too many open files"

with several hours running soundplay_node.py, this node crashes with error "Too many open files".

(soundplay_node.py:4545): GStreamer-CRITICAL **: gst_poll_free: assertion `set != NULL' failed
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started

(soundplay_node.py:4545): GStreamer-CRITICAL **: gst_poll_write_control: assertion `set != NULL' failed

(soundplay_node.py:4545): GStreamer-CRITICAL **: gstsystemclock: write control failed in wakeup_async: 24:Too many op
en files


(soundplay_node.py:4545): GStreamer-CRITICAL **: gst_poll_free: assertion `set != NULL' failed

(soundplay_node.py:4545): GStreamer-CRITICAL **: gst_poll_write_control: assertion `set != NULL' failed

(soundplay_node.py:4545): GStreamer-CRITICAL **: gstsystemclock: write control failed in wakeup_async: 24:Too many op
en files


(soundplay_node.py:4545): GStreamer-CRITICAL **: gst_poll_free: assertion `set != NULL' failed
can't open /proc/cpuinfo
: Too many open files

Maybe forgot to close file descriptor after playing audio file?

sound_play keeps generating soundplay_node.py and makes weird sound (ros ticket #9)

As reported in detail in the QA thread ( http://answers.ros.org/question/3212/sound_play-consumes-high-cpu-and-makes-strange), soundplay_node.py instance doesn't stop increasing under certain circumstance and consume significant amount of CPU which makes it hard to keep running everything on the same computer.

trac data:

Add license file

Engineers at Google would like to use and commit back to this project but currently cannot due a lack of a license file. Can someone add a BSD license to this repository?

Failed to find rosdep items on on OS:ubuntu version:10.04 (ros ticket #4)

Hi,

I would like to report that while following the tutorial steps for audio_common, ( http://www.ros.org/wiki/audio_common/Tutorials/Streaming%20audio ) , at the step for installing the ROS dependencies I encounter the error:

shanker@StudioXPSubuntu:~/Workspace/Aux-ROS-Packages/audio_common$ rosdep install audio_common
Failed to find rosdep gstreamer for package sound_play on OS:ubuntu version:10.04
Failed to find rosdep festival for package sound_play on OS:ubuntu version:10.04
Failed to find rosdep gstreamer for package audio_capture on OS:ubuntu version:10.04
Failed to find rosdep gstreamer for package audio_play on OS:ubuntu version:10.04
ERROR: ABORTING: Rosdeps [u'gstreamer', u'festival', u'gstreamer', u'gstreamer'] could not be resolved

I suppose the solution would be to ignore that and install these packages from Synaptic Package Manager for example. I have done so and installed 'libgstreamer0.10', 'libgstreamer0.10-dev', 'libgstreamermm-0.10-dev' and 'festival' from Synaptic Package Manager.

I then followed the rest of the tutorial, and at the step "Testing your setup" upon execution of the command 'gst-launch-0.10 alsasrc ! audioconvert ! audioresample ! alsasink', I do hear my input being played back to me, with a little delay.

However, at the final step of using audio_capture and audio_play, I do not hear any output. I would also like to note that I have also recorded a bag file while running audio_capture, and the bag file did not have any data under the /audio topic.

I wonder if the problem is with the aforementioned 'rosdep' issue, and that I have installed an incorrect dependency. On the other hand, could it be that I am using a Macbook and the soundcard in question is not handled by audio_capture?

Thank you,
Regards,
Shanker Keshavdas
Researcher , DFKI Saarbruecken,
Germany

trac data:

'volume' error using sound_play

I can't find a way a make sound_play work. I've been searching for days already, but I can't find a fix to this error. Have any of you ever experienced this error?

$ rosrun sound_play say.py 'Hello again'

Saying: Hello again Voice: voice_kal_diphone Traceback (most recent call last): File: "/opt/ros/indigo/lib/sound_play/say.py", line 79, in print 'Volume: %s' % volume NameError: name 'volume' is not defined

Playing built-in sounds fails under Hydro

My setup: Ubuntu 12.04 with the latest Hydro Debian install. Here's how to reproduce the problem:

$ rosrun sound_play soundplay_node.py
$ rosrun sound_play playbuiltin.py 1
Playing sound 1.

No sound is heard and back in the soundplay_node terminal we see:

[INFO] [WallTime: 1384872577.704429] sound_play node is ready to play sound
[ERROR] [WallTime: 1384872581.128748] Error: URI is invalid: /opt/ros/hydro/lib/sound_play/../sounds/BACKINGUP.ogg
[ERROR] [WallTime: 1384872581.129216] Exception in callback: local variable 'uri' referenced before assignment
[INFO] [WallTime: 1384872581.129848] Traceback (most recent call last):
  File "/opt/ros/hydro/lib/sound_play/soundplay_node.py", line 227, in callback
    self.builtinsounds[data.sound] = soundtype(params[0], params[1])
  File "/opt/ros/hydro/lib/sound_play/soundplay_node.py", line 88, in __init__
    self.uri = uri
UnboundLocalError: local variable 'uri' referenced before assignment

capture timestamped audio (ros ticket #19)

I have added a new node (and msg) that enables the ability to capture timestamped audio (in raw). This would be useful for precisely determining when captured sounds happen, such as the click from an SLR camera, and then they can be synchronised with other sensors.

Here is a patch in case this can be added to the project.

trac data:

Inconsistency in sound_play documentation and code (ros ticket #23)

While the documentation of the sound_play node says that more than one sound at a time can be played, this appears not to be the case (even when calling it from the same node).

Lines 181-182 of soundplay_node.py are "Force only one sound at a time" and "self.stopall()". Commenting out the latter seems to allow multiple sounds to be played at once.

Either the documentation or the code should probably be changed, however, I have not experimented significantly to determine whether commenting out line 182 of soundplay_node.py leads to undesirable effects.

trac data:

rosdep install audio_common does not resolve issues for rosdep install audio_capture, etc

On a Ubuntu 15.05 64-bit system running ROS Jade:

After following the tutorial here: http://wiki.ros.org/audio_common/Tutorials/Streaming%20audio
and installing from source audio_capture had an unmet dependency on gstreamer-0.10.

rosdep install audio_common## reported everything being installed.

However, audio_capture still had the missing dependency. Finally

rosdep install audio_capture## solved the issue.

Shouldn't this already happen on rosdep install audio_common?

How to change the subscriber of audio_play?

Hi, the normal things are, it captures the audio data from audio_capture and publish the data on the topic "audio", then the audio_play subscribe the topic "audio" to get data and play it. Now, the things are changing, first it get the data from audio_capture and then do some thing to change the data and publish the changed data on a new topic, for example "audio_test", so, how to change the subscriber of audio_play to play the new topic's data?
Why to change the data of audio_capture? first it get data from audio_capture, then change the audio data to text, maybe the text is a question, then we need to find an answer for it, when we get the answer, we should change the answer to audio and play it.
Would any one help me?
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.