audio-player

Sound Play / Stop / Pause

拥有回忆 提交于 2020-07-06 10:04:29
问题 I'm developing a sound JavaScript library. I can play sound with below code. var soundPlayer = null; function playSound(){ soundPlayer = new Audio(soundName).play(); } How can I stop and pause this audio? When I try like this: soundPlayer.pause(); Or soundPlayer.stop(); But I get this error: Uncaught TypeError: soundPlayer.stop is not a function How can I do that? 回答1: If you change that: soundPlayer = new Audio(soundName).play(); To that: soundPlayer = new Audio(soundName); soundPlayer.play(

jlayer.javazoom player can not stop mp3

自作多情 提交于 2020-06-18 05:39:32
问题 How to stop MP3 in jlayer? ( the stop() is no longer used) My code as follows: //main class mp3_main private AdvancedPlayer player; public static void main(String[] args) { String file="C:\\cd.mp3"; mp3PlayerSample mp3 = new mp3PlayerSample(file); mp3.play(); mp3.stop(); } //class mp3PlayerSample private String filename; private BufferedInputStream buffer; private AdvancedPlayer player; //constructor public mp3PlayerSample(String filename) { this.filename = filename; } //start method public

AVAudioPlayerDelegate doesn't call the method

随声附和 提交于 2020-06-17 09:23:45
问题 Here is the method inside a class: import UIKIt import Foundation class notMoving { var drumPlayerObject = drumPlayer() var fileManagerObject = fileManager1() let drumStrength = 1 var bassStrength = 1 var synthStrength = 1 var indexToPlay: Int = 0 // here we start the drum player. func startToPlay() { fileManagerObject.clearPlayedListDrum(drumStrength, KeyNoteOfInstDrum: "C") if let indexToPlay = fileManager1().randomizeTheNextInstrument(fileManager1().drums, Strength: drumStrength, KeyNote:

C# How to access the current playback of windows

老子叫甜甜 提交于 2020-04-11 18:37:54
问题 at Windows 10 there is a Music Feature(Pic Below): So my Question is: How can I access this information with C# and which libraries do i need? Thanks for helping 回答1: Excuse me for my ignorance, but if I am correct, this widget is a pop up of Spotify, isn't this? In that case, you only have to check the MainWindowsTitle of spotify process. var spotify = Process.GetProcessesByName("Spotify"); foreach (var song in spotify) { Console.WriteLine(song.MainWindowTitle); } Console.ReadLine(); Don't

How to implement Exoplayer 2.11.1 in android?

六眼飞鱼酱① 提交于 2020-04-11 02:16:08
问题 i am trying to implement exoplayer this is my exoplayer version implementation 'com.google.android.exoplayer:exoplayer:2.11.1' i am creating a music player app and i don't know anything about exoplayer i am trying to implement exoplayer from last 2 days but it's not working. i couldn't understand anything in the official documentation . i find many example and tutorial but it's all about playing video using exoplayer . many example's are using deprecated methods. I am trying to implement

Detect if audio is playing in browser Javascript

本小妞迷上赌 提交于 2020-04-08 09:08:25
问题 Is there a global way to detect when audio is playing or starts playing in the browser. something like along the idea of if(window.mediaPlaying()){... without having the code tied to a specific element? EDIT: What's important here is to be able to detect ANY audio no matter where the audio comes from. Whether it comes from an iframe, a video, the Web Audio API, etc. 回答1: No one should use this but it works. Basically the only way that I found to access the entire window's audio is using

How to get read external storage permissions?

一个人想着一个人 提交于 2020-03-13 07:56:00
问题 I'm developing an mp3 player application for android and I'm getting an error related to user permissions(READ_EXTERNAL_STORAGE) This is my code where I ask for permissions: int permissionCheck = ContextCompat.checkSelfPermission(PlayListActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE); if (ContextCompat.checkSelfPermission(PlayListActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { // OPCIONAL(explicaciones de poque pedimos los permisos)

How do I alter this function so that only one, random song can be played at a time with each click? (JavaScript)

孤街醉人 提交于 2020-01-25 07:27:29
问题 I'm essentially building a music generator/player app using HTML, CSS, and vanilla JavaScript where every time a user clicks a particular div with respect to a particular genre of music, a new song from that genre is played. To generate a random song, I created this JS function: const randomizeSongs = playlist => { let song = playlist[Math.floor(Math.random() * playlist.length)]; song.play(); } The issue I've run into is when I tried using the following code: const pop = document

Building a simple mp3 music player [closed]

岁酱吖の 提交于 2020-01-20 07:20:42
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . It is possible for me to write a simple mp3 music player? If yes, how should I go about building it? Are there any online resources that can help? 回答1: This would be the basis of creating a Flash based MP3 player: http://www.macloo.com/examples/audio_player/ Your question is a

Building a simple mp3 music player [closed]

喜欢而已 提交于 2020-01-20 07:19:05
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . It is possible for me to write a simple mp3 music player? If yes, how should I go about building it? Are there any online resources that can help? 回答1: This would be the basis of creating a Flash based MP3 player: http://www.macloo.com/examples/audio_player/ Your question is a