playback

Play and pause one HTML5 audio element at a time via jQuery

牧云@^-^@ 提交于 2019-12-04 04:24:22
I've got several HTML5 audio elements on a page and am using jQuery to play and pause them. The play and pause functions work appropriately, but the tracks can all be played at the same time. How can I rewrite this code so that only one song can be played at a time? That is.. if one is playing and you click on another, pause the previous and play the most recent click. Thank you! HTML: <div id="music_right"> <div class="thumbnail" id="paparazzi"> <a class="playback"> <img class="play" src="http://www.lucisz.com/imgs/play.png" /> </a> <audio> <source src="../audio/fernando_garibay

Alsa 小结

天涯浪子 提交于 2019-12-04 03:40:25
ALSA小结,从网上转载的,不知道原来的地址了 关于alsa的总结: 一. alsa展现的三层结构: (1)audio interface: audio interface就是声卡,它含有hardware buffer,注意,这个hardware buffer是在声卡里面,不是内存。 (2)computer: 这个指的是计算机的内核和驱动(驱动由alsa提供),当(1)的audio interfacce引发中断,内核会捕捉到,再把处理移交alsa。 (3)application: 这个就是你写的程序,你开辟一个buffer,比如playback,就交给alsa来play。 在上面的框架下,流程如下: (1)playback: application开辟一个buffer,填上数据,调用alsa接口,alsa把buffer数据复制到其驱动的空间,再把数据交给 hardware buffer。 (2)record: 同playback,相似的。 二. 细节: 按照上面的流程,其中有许多细节我们可以加以控制,这里仅仅指出应用程序需要关心的: 2.1 操作的设备: 在alsa驱动这一层,目前为止,抽象出了4层设备,一是如hw:0,0,二是plughw:0,0,三是default:0,四是default。至于 一是清楚了,二和二以上可以做数据转换,以支持一个动态的范围

How to get redirector.googlevideo.com link from a Google drive video

不想你离开。 提交于 2019-12-04 03:40:00
I have a google drive video file (like https://drive.google.com/file/d/FILE_ID/view ) and I want to get its redirector.googlevideo.com link. How do sites like http://api.getlinkdrive.com/ do it? I've tried using the Google Drive REST API, (both v2 and v3) but still can't find a way to do it. Many tv-show and movie sites host their content on google drive, and use this "cloaked" URL that expires so you can't for example embed it somewhere else. The closest I've gotten is by going to docs.google.com/get_video_info?docid=FILE_ID and getting the fmt_stream_map links, but that doesn't return the

【ALSA】关于alsa的总结

本秂侑毒 提交于 2019-12-04 03:32:22
一. alsa展现的三层结构: (1)audio interface: audio interface就是声卡,它含有hardware buffer,注意,这个hardware buffer是在声卡里面,不是内存。 (2)computer: 这个指的是计算机的内核和驱动(驱动由alsa提供),当(1)的audio interfacce引发中断,内核会捕捉到,再把处理移交alsa。 (3)application: 这个就是你写的程序,你开辟一个buffer,比如playback,就交给alsa来play。 在上面的框架下,流程如下: (1)playback: application开辟一个buffer,填上数据,调用alsa接口,alsa把buffer数据复制到其驱动的空间,再把数据交给 hardware buffer。 (2)record: 同playback,相似的。 二. 细节: 按照上面的流程,其中有许多细节我们可以加以控制,这里仅仅指出应用程序需要关心的: 1) 操作的设备: 在alsa驱动这一层,目前为止,抽象出了4层设备: 一是如hw:0,0,二是plughw:0,0,三是default:0,四是default至于 一是清楚了,二和二以上可以做数据转换,以支持一个动态的范围,比如你要播放7000hz的东西,那么就可以用二和二以上的。而你用7000hz作为参 数,去设置一

ALSA调试总结

╄→尐↘猪︶ㄣ 提交于 2019-12-04 03:31:40
刚刚解决了一个播放不出声音的问题,这里总结一下,在TI平台上调试ALSA的一些方法和步骤。 平台ALSA信息 ls /dev/snd/ controlC0 controlC1 pcmC0D0c pcmC0D0p pcmC0D10p pcmC0D11c pcmC0D12p pcmC0D13p pcmC0D14c pcmC0D14p pcmC0D15c pcmC0D15p pcmC0D16c pcmC0D16p pcmC0D17c pcmC0D17p pcmC0D18c pcmC0D19c pcmC0D1c pcmC0D20c pcmC0D2c pcmC0D2p pcmC0D3p pcmC0D4p pcmC0D5c pcmC0D5p pcmC0D6p pcmC0D7c pcmC0D7p pcmC0D8p pcmC0D9c pcmC1D0p timer cat /proc/asound/cards 0 [SDP4430 ]: OMAP4 – SDP4430 TI OMAP4 Board 1 [OMAP4HDMI ]: – OMAP4HDMI OMAP4HDMI cat /proc/asound/devices 2: [ 0-20]: digital audio capture 3: [ 0-19]: digital audio capture 4: [ 0-18]: digital

How to play video in VideoView?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 16:19:45
I want to play video in VideoView . When I try to do that I got the following error: Here is my source code: package com.video.listitem; import android.app.Activity; import android.content.pm.ActivityInfo; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import android.widget.MediaController; import android.widget.VideoView; public class PlayVideo extends Activity { VideoView mVideoView; MediaController mc; String videourl; @Override protected void onCreate(Bundle savedInstanceState) { super

Black screen when returning to video playback activity in Android

余生颓废 提交于 2019-12-03 09:11:18
问题 I'm currently developing the android application ServeStream and I've encountered and problem that I can't fix. My application will stream music and video using the android MediaPlayer class. I've modeled my class after the example found at: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo_Video.html The difference between this example and my own code is my MediaPlayer is runs in a service which allows it to continue playback in the

Directory for storing audio files in Android

末鹿安然 提交于 2019-12-03 03:03:11
问题 I want to play an audio file based on the click of a button. I have defined the onClickListener() method and the layout file. When I add the wav files to the res/ directory, I get the following build error: invalid resource directory name temp.wav /hello/res line 1 Android AAPT Problem My question is as follows: 1. What directory do I need to store audio files in? Currently they are in the res/ folder. 2. Also, mp.setDataSource("/res/temp.wav") the correct way to invoke the media player? 回答1:

How to play .mp3 file from resources in C#?

懵懂的女人 提交于 2019-12-03 00:30:43
I put music.mp3 in resources and then I added Windows Media Player to references. I wrote this code: WindowsMediaPlayer wmp = new WindowsMediaPlayer(); wmp.URL = "music.mp3"; wmp.controls.play(); It doesn't work. How can I play .mp3 file from resources? I did it: WindowsMediaPlayer wmp = new WindowsMediaPlayer(); Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PostGen.Resources.Kalimba.mp3"); using (Stream output = new FileStream ("C:\\temp.mp3", FileMode.Create)) { byte[] buffer = new byte[32*1024]; int read; while ( (read= stream.Read(buffer, 0, buffer.Length)) > 0

Black screen when returning to video playback activity in Android

不羁的心 提交于 2019-12-02 23:24:53
I'm currently developing the android application ServeStream and I've encountered and problem that I can't fix. My application will stream music and video using the android MediaPlayer class. I've modeled my class after the example found at: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo_Video.html The difference between this example and my own code is my MediaPlayer is runs in a service which allows it to continue playback in the background. The problem with the example android code is if I'm watching a video and I leave the current