# MediaCtrl audio not playing

**URL:** <https://www.ruby-forum.com/t/mediactrl-audio-not-playing/192853>\
**Category:** wxRuby\
**Created:** [August 7, 2010, 12:32am UTC](https://www.ruby-forum.com/t/mediactrl-audio-not-playing/192853 "2010-08-07T00:32:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![remosewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@remosewa](https://www.ruby-forum.com/u/remosewa)\
**Post date:** [August 7, 2010, 12:32am UTC](https://www.ruby-forum.com/t/mediactrl-audio-not-playing/192853/1 "2010-08-07T00:32:04Z")

</div>

Ok, so I have this weird problem, where I load an audio file into a  
mediacontrol with an unspecified backend.(i call it like this:  
@mediacontrol = Wx::MediaControl.new(self)) I wanted the audio to play  
after the audio is loaded. I.e user pressed load, and after it loads, it  
plays. However, it loads, but doesn’t play.

Sometimes when you push the play button it will work, but some audio  
files (which open fine in Windows media player) wont open.

The really weird thing is this code makes it play:

if not @mediacontrol.play  
text = Wx::TextEntryDialog.new(self, “input string”,“Please enter  
text”)  
text.show\_modal  
@mediacontrol.load(text.get\_value)  
end

Can anyone help me understand why this is? I don’t want to have to open  
up a dialog every time I play an audio file.
