media-player

MediaMetadataRetriever on streaming source

自闭症网瘾萝莉.ら 提交于 2019-11-29 03:58:38
I am having a tough time displaying the current track playing from a streaming source. Using MediaMetaDataRetriever class returns a NULL, meaning it failed. I wrote a simple method but now I'm inclining to think this only works on media files like MP3, WMA, AVI, etc. public void metaData(){ mmr.setDataSource(urlStation); String metaD = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST); Toast.makeText(MainActivity.this, "Artist = " + metaD, Toast.LENGTH_LONG).show(); Any good and easy recommandations would be greatly appreciated. Thank you for your time!

A simple C program to play mp3 using libvlc

你离开我真会死。 提交于 2019-11-29 03:57:09
问题 I am an average C/C++ programmer. Recently I took a project to make a media player with a smart playlist that will work like Zune's SmartDj. I have decided to use libvlc for playing. I have never coded an open source software before, so I know nothing about git and all. Can you please help me to write at least a C program to play a mp3 file? Where should I get started? How do you extract a song's artist and other information from the mp3 file itself? regards. 回答1: be sure that you have

Android MediaPlayer - how to play in the STREAM_ALARM?

倾然丶 夕夏残阳落幕 提交于 2019-11-29 03:46:01
I've tried settings the audio stream of the media player in my application using the following code but when I do this I hear no sound in the emulator. If I don't set the stream for the player then the audio plays fine. I'm sure I'm using this wrong but cannot workout how, any help? MediaPlayer player = MediaPlayer.create(getApplicationContext(), R.raw.test_audio); AudioManager audioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE); audioManager.getStreamVolume(AudioManager.STREAM_ALARM); audioManager.setStreamVolume(AudioManager.STREAM_ALARM,

How to play Audio file Mp3 from the server [duplicate]

╄→尐↘猪︶ㄣ 提交于 2019-11-29 02:25:22
问题 This question already has an answer here: How can I play a mp3 without download from the url? [closed] 6 answers I want to play audio from the live server. I don't want to download these audio files. Format of these files are mp3.working on android java. 回答1: try { MediaPlayer player = new MediaPlayer(); player.setAudioStreamType(AudioManager.STREAM_MUSIC); player.setDataSource("http://xty/MRESC/images/test/xy.mp3"); player.prepare(); player.start(); } catch (Exception e) { // TODO: handle

Capture OSX media control buttons in Swift

怎甘沉沦 提交于 2019-11-29 02:24:24
I would like my app to respond to the F7 , F8 and F9 keyboard media control buttons. I am aware of this lovely library but it is not working in combination with Swift: https://github.com/nevyn/SPMediaKeyTap Serneum I actually solved this problem myself just the other day. I wrote a blog post on it, as well as a Gist I'll embed the blog post and final code just in case the blog or Gist ever go away. Note: This is a very long post that goes into detail about how the class in constructed and what you can do to call other methods in your App's delegate. If all you want is the finished product (the

How to set WPF window position in secondary display

≯℡__Kan透↙ 提交于 2019-11-29 01:20:40
I have two displays. I want to make a media player and I want to play video full screen on my secondary display. So I’m trying to make a media player using WPF Here is the code so far I wrote Screen[] _screens = Screen.AllScreens; System.Drawing.Rectangle ractagle = _screens[1].Bounds; //player is my window player.WindowState = WindowState.Maximized; player.WindowStyle = WindowStyle.None; player.Left = ractagle.X; player.Top = ractagle.Y; // MediaControl is an media elements MediaControl.Height = ractagle.Height; MediaControl.Width = ractagle.Width; But somehow it’s just playing on my first

Android media player and seekbar sync issue

爱⌒轻易说出口 提交于 2019-11-29 00:41:35
I am working on a media player app. I am trying to sync it to a seekbar so that when media is played the seek bar progresses automatically. Here is my source code: public class MusicDroid extends ListActivity implements SeekBar.OnSeekBarChangeListener, Runnable { private int cur_time = 0; private SeekBar seekbar; int song_dur = 0; GroveService gs; public Chronometer timer; int timer_time = 0; @Override public void onCreate(Bundle icicle) { try { super.onCreate(icicle); setContentView(R.layout.songlist); gs = new GroveService(); gs.updateSongList(); } catch (NullPointerException e) { Log.v

Problems with MediaPlayer, raw resources, stop and start

人盡茶涼 提交于 2019-11-28 22:29:16
问题 I'm new to Android development and I have a question/problem. I'm playing around with the MediaPlayer class to reproduce some sounds/music. I am playing raw resources ( res/raw ) and it looks kind of easy. To play a raw resource, the MediaPlayer has to be initialized like this: MediaPlayer mp = MediaPlayer.create(appContext, R.raw.song); mp.start(); Until here there is no problem. The sound is played, and everything works fine. My problem appears when I want to add more options to my

How to attach MediaPlayer with SurfaceView in android?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 19:43:36
I'm building video player with android media player object. i'm able to hear the audio but the video does not appear on surfaceView. here is my code public class PlayerActivity extends Activity implements SurfaceHolder.Callback { String path; private MediaPlayer mp; private SurfaceView mPreview; private SurfaceHolder holder; boolean pausing = false; public static String filepath; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_player); getWindow().setFormat(PixelFormat.UNKNOWN); mPreview = (SurfaceView

“binary was not built with debug information ” warning meaning in mfc application?

坚强是说给别人听的谎言 提交于 2019-11-28 19:15:50
I am getting the following Warning when i run my Windows Application(MFC) in Windows 7. 'XXX.exe': Loaded 'C:\2010\Debug\bin\plugins\control\libhotkeys_plugin.dll', Binary was not built with debug information. Please Help Me out.Thank You It seems that your binary was build in Release mode Now there are two ways which you can follow.... build the binary with "Debug" configuration change the project settings so that a Program Database file (PDB) is generated in the release mode. Now you can generate PDB from the property window... Abdul Rauf If your project is already in Debug mode . Please