audio-player

Implementing next button in audio player android

ⅰ亾dé卋堺 提交于 2019-12-11 17:43:56
问题 I have been trying to implement next song button in my audio player app. I copied some code from a tutorial but its not working.The button for next song is btnNext and the method is cde(), its the last method in the code. The button gets clicked but next song is not played, current song keeps playing.How do I fix this ? package com.example.dell_1.myapp3; import android.app.Activity; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import

Windows IoT Raspberry Pi 3 c# Audio Playback in Different Pages

空扰寡人 提交于 2019-12-11 17:32:36
问题 I am making an app on Rasp Pi 3 where I can trigger a button on "Playback Page" to activate an audio playback using MediaPlayer in a page. Once I switch to another page, the audio will remain playing in the background but once I navigate back to the "Playback Page" the audio is still playing but i lost control of the MediaPlayer due to my mediaPlayer = new MediaPlayer(); line. if it's on repeat mode I can't stop playing & if i trigger another message, both new & existing message will play

Manifest merger failed while adding io.github.jeancsanchez.jcplayer:jcplayer:0.0.2

旧巷老猫 提交于 2019-12-11 16:11:56
问题 I am trying add jc player in my project. but when i try to sync gradle the give the following error. what should i do? Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher_round) from AndroidManifest.xml:14:9-49 is also present at [io.github.jeancsanchez.jcplayer:jcplayer:0.0.2] AndroidManifest.xml:14:9-43 value=(@mipmap/ic_launcher). Suggestion: add 'tools:replace="android:icon"' to element at

Android:open default audio player

狂风中的少年 提交于 2019-12-11 13:58:00
问题 I am making an app in which I have to open default audio player. My code is as follows: Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); File file = new File(songs.get(position)); //String introURI = "file:///sdcard/"+".mp3"; intent.setDataAndType(Uri.fromFile(file), "audio/*"); startActivity(intent); When the song is touched, the player gets open but it gives message that "this type of file is not supported". 回答1: The MediaPlayer class should be used when

How to save “now playing” list of Music Player App in Android?

可紊 提交于 2019-12-11 05:35:59
问题 I'm going to create a simple Musicplayer for Android using Service. But I don't know the best way to save list of nowplaying. I used a database to store the list, but in this way, each time I start main player activity, I must read database and store to an array list and each time I update nowplaying, I must update the database. This way make waste of time and sometime data between Database and Arraylist is difficult to synchonized. What's the best way to solve this problem? - Store

How do I get music to persist as I navigate from view to view?

让人想犯罪 __ 提交于 2019-12-11 02:22:55
问题 So, I have mastered the art of playing sounds/music using one view in iOS, but I am now trying to make a more robust app for an musical artist. Thus far, it involves segues from a "menu" ViewController to his Bio, Show Times, and "Listening Room" etc. Thus far, I created a an "AudioManager" class: import UIKit import AVFoundation import MediaPlayer class AudioManager: NSObject { let defaltSong = ["Hell&BackCaf/01 Black Sheep", "caf"] weak var delegate : PlayerDelegate? var musicPlayer1 =

Play multiple songs with Android intent

不羁的心 提交于 2019-12-11 01:49:08
问题 In my application, I need to launch the Android Music Player. And, for now, it works perfectly : Intent intent = new Intent(android.content.Intent.ACTION_VIEW); File file = new File(file_path); intent.setDataAndType(Uri.fromFile(file), "audio/*"); startActivity(Intent.createChooser(intent, "...")); But the user can't use the "next" and "prev" buttons to switch music. That's why I try to launch multiple songs at once (a playlist). And I don't really know how to do this! Give an array to the

MediaPlayer plays the music files only in debug mode ( Android )

别等时光非礼了梦想. 提交于 2019-12-10 17:17:41
问题 I have written an Android application ( in eclipse) that plays a music file as follows: MediaPlayer mediaPlayer = new MediaPlayer(); try { mediaPlayer.setDataSource(fileName); mediaPlayer.prepare(); mediaPlayer.start(); // mediaPlayer.stop(); } catch (Exception e) { Log.d("Exception---", e.getMessage()); } When I run it, it does not play the file ( and does not show any exception ), but when I switch to 'debug mode', and trace it line by line, it plays the file. I'm really confused. Would you

pygame.mixer.music.play() doesn't recognize Fast Tracker (.xm music format) repeat position

会有一股神秘感。 提交于 2019-12-10 02:44:49
问题 The problem is: I try to play Fast Tracker module in infinite loop, but doing so just replay music from start, instead of following repeat position. Example: (here's the source for module https://api.modarchive.org/downloads.php?moduleid=153915#zeta_force_level_2.xm) import pygame pygame.mixer.init() pygame.mixer.music.load('/path/to/zeta_force_level_2.xm') pygame.mixer.music.play(-1) What I'm trying to achieve: Play module music in loop, each time looping on repeat position, not on start of

HTML5 Audio gets louder after pausing then playing again

此生再无相见时 提交于 2019-12-08 19:51:39
I'm making an audio player with JavaScript, everything works fine until I add a sound visualizer. When I pause the song and then play it again, the sound gets more louder every time I do it, until it gets distorsionated. I'm newbie with the HTML5 Audio API, I've tried to set the volume as a fixed value, but not works. The code of the visualizer it's: function visualizer(audio) { let context = new AudioContext(); const gainNode = context.createGain(); gainNode.gain.value = 1; // setting it to 100% gainNode.connect(context.destination); let src = context.createMediaElementSource(audio); let