我正在尝试使用AVAudioPlayer滑块以寻找轨道(没有任何复杂的).
但我有一个奇怪的行为......对于某些值currentTime(在0和trackDuration之间),玩家停止播放音轨,并audioPlayerDidFinishPlaying:successfully:
成功进入NO.它没有进入audioPlayerDecodeErrorDidOccur:error:
这就像它无法读取我给它的时间.
例如,轨道的持续时间为:295.784424秒我将其设置currentTime为55.0s(即:54.963878或54.963900或54.987755等,当打印为%f时)."崩溃"总是发生在currentTime54.987755 ......我真的不明白为什么......
所以如果你有任何想法...... ^^
我在我的网站www.missduniya.com上添加了一个html5音频标签来播放背景音乐,它适用于所有主流浏览器,但它不适用于IE.
这是我的代码
<audio controls="CONTROLS" autoplay="autoplay" style="display:none;">
<source src="destination.ogg" type="audio/ogg">
<source src="destination.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Run Code Online (Sandbox Code Playgroud)
请通过提供解决方案来帮助我:)谢谢
我有一个音乐应用程序.将歌曲信息和音乐控件显示在SoundCloud等锁定屏幕上的最佳方法是什么 - 请参阅(http://cl.ly/image/1a1H041A1Z34)
非常感谢你!
我为Windows Phone 8.1开发了音乐应用程序.我使用BackgroundTask并访问手机音乐库.应用程序在具有虚拟SD卡的模拟器上工作正常,但在设备上不起作用.在设备上尝试播放时,会发生错误:
Failed with error code System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Run Code Online (Sandbox Code Playgroud)
此问题代码,发生错误.为简单城市放置在前台应用程序中的代码:
BackgroundMediaPlayer.Current.SetUriSource(new Uri("C:\\Data\\Users\\Public\\Music\\Ballroom\\Juan Camus - Now That The Love's Gone.mp3"));
BackgroundMediaPlayer.Current.Play();
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?
background-music media-player audio-player windows-phone windows-phone-8.1
好的,我正在Android Studio中创建一个名为Fall Down 4的应用程序.现在,我需要知道一旦我运行我的应用程序,我是否可以播放音乐.
我知道如果你点击某个按钮就开始播放音乐,但这不是我想要的.我想知道如果有什么办法,当我运行我的应用程序时,它只是开始播放音乐.
例如:许多游戏在您运行时在后面播放音乐,然后您可以在设置中选择将其关闭.一场比赛将落入Delux,音乐一直播放,直到我按下关闭按钮.
所以请告诉我,如果有任何方法可以做我上面解释的内容.
谢谢.
我需要创建一个音频播放器,但我不知道如何将其转换为 JavaScript。
这就是我到目前为止所拥有的......
HTML:
<audio id="music" src="http://www.sousound.com/music/healing/healing_01.mp3"
data-title="Title of the audio" data-author="Author's name"></audio>
<span class="volumeScaleHolder">
<span id="progressBar">
<span id="myVolume"></span>
</span>
</span>
Run Code Online (Sandbox Code Playgroud)
CSS:
#progressBar {
width: 100%;
height: 8px;
background-color: #666666;
display: inline-block;
}
#myVolume {
width: 10%;
height: 100%;
background-color: #B4BB6B;
display:block;
}
border: 0;
}
.volumeScaleHolder {
padding:0;
margin: 3px 0;
}
Run Code Online (Sandbox Code Playgroud)
JavaScript:
var audio = document.getElementById("music");
var audioVolumeBar = document.getElementById("progressBar");
var myVolumeBar = document.getElementById("myVolume");
var audioVolume = audio.volume;
function volumeAsProgressBar(volume) {
var audioVolumeProgressBar = document.getElementById("progressBar");
var audioVolumeMyBar = …Run Code Online (Sandbox Code Playgroud) 我audioplayer.js在 html5 页面上有超过 5 个音频播放器。
有没有人在 js 中有一个简单的脚本来在当前播放器播放时暂停所有其他播放器?
jQuery:
$( function(){
$("audio").audioPlayer();
});
Run Code Online (Sandbox Code Playgroud)
图书馆
https://osvaldas.info/examples/audio-player-responsive-and-touch-friendly/audioplayer.js
Run Code Online (Sandbox Code Playgroud)
我试过如下
window.player = $('audio')[0];
$('.audioplayer-playpause').click(function () {
if (player.paused) {
player.play();
} else {
player.pause();
}
});
Run Code Online (Sandbox Code Playgroud)
我制作了一个 jsFiddle 只是为了简化事情,下面是链接:
我创建了一个应用程序来扫描手机上的音乐文件。如果我扫描文件夹/sdcard/Music,它会扫描音乐文件,但在我写入/sdcard时它不会扫描 mp3 文件。它工作正常。但它在某些设备上不起作用,应用程序崩溃可能是因为该手机上不存在该路径我该怎么办?
代码
public class SongsManager {
// SDCard Path
String MEDIA_PATH = new String("/sdcard/Music");
private ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>();
// Constructor
public SongsManager() {
}
/**
* Function to read all mp3 files from sdcard
* and store the details in ArrayList
*/ public ArrayList<HashMap<String, String>> getPlayList(){
File home = new File(MEDIA_PATH);
if (home.listFiles(new FileExtensionFilter()).length > 0) {
for (File file : home.listFiles(new FileExtensionFilter())) {
HashMap<String, String> song = new HashMap<String, …Run Code Online (Sandbox Code Playgroud) 我有背景音乐,这是一个 6 分钟的循环。这首歌有 4 个部分,它可以从这些部分中的任何一个开始播放。
如何在 Unity 中开始播放歌曲的特定部分?
我以前使用 just_audio 并且我正在像这样获取当前时间
player.positionStream.listen((event) {
playerTimeNow = event;
updatePlayerBar();
});
Run Code Online (Sandbox Code Playgroud)
audio-player ×10
javascript ×3
android ×2
iphone ×2
audio ×1
c# ×1
dart ×1
flutter ×1
html ×1
html5 ×1
html5-audio ×1
ios ×1
ios7 ×1
jquery ×1
just-audio ×1
lockscreen ×1
media-player ×1
progress ×1