audio

How to play sound when a notification pops up?

∥☆過路亽.° 提交于 2020-04-07 09:26:30
问题 I'm working on an app where using two switch buttons the user can turn on/off notifications and notification sound. I created the notifications that pop up on the status bar and I want to play a default sound when they appear.I wrote the following code but it doesn't seem to work. Any ideas about how can I make the notification sound play ? import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Notification; import android.app.NotificationChannel;

OpenAL® and Windows Vista™

一曲冷凌霜 提交于 2020-04-07 07:42:40
http://www.openal.org/openal_vista.html Introduction With the launch of Windows Vista just around the corner, both gamers and game developers are asking questions about audio compatibility with OpenAL. This document is intended to address the issues. The OpenAL API will provide a direct path to any native OpenAL driver for delivering premium quality interactive 3D audio for gaming on Windows Vista. Since Windows Vista does not inherit the hardware abstraction layer for audio that was present under previous versions of Windows, including Windows XP, there will be no more hardware acceleration

jQuery仿QQ音乐播放器

痞子三分冷 提交于 2020-04-06 02:12:09
本文通过Html+CSS+jQuery开发仿QQ版的音乐播放器,是前端技术的综合应用,所用素材来源于网络,仅供学习分享使用,如有不足之处,还请指正。 涉及知识点 在本例中用到的知识点如下,按jQuery和CSS进行区分: jQuery 是一个 JavaScript 库, 极大地简化了 JavaScript 编程,常见知识点如下: 通过标签获取jQuery对象:var $audio =$("audio"); 通过选择符获取jQuery对象并设置文本内容:$(".music_progrss_time").text(timeStr); 通过选择符,标签名获取对象并获取第i个子元素:$(".song_lyric ul li").eq(index); 通过ajax异步获取数据并刷新页面:$.ajax({}); 通过类选择符获取元素并进行隐藏或显示:$(this).find(".list_menu").stop().fadeIn(100); 通过委托动态设置单击事件,主要针对动态生成元素:$(".content_list").delegate(".list_check", "click", function() {}); 通过addClass添加类,removeClass删除类,toggleClass切换类,hasClass是否包含类 获取与对象同级的兄弟节点:$musicList

iOS---后台运行机制详解

混江龙づ霸主 提交于 2020-04-06 01:50:05
一、iOS的“伪后台”程序 首先,先了解一下iOS 中所谓的「后台进程」到底是怎么回事吧? Let me be as clear as I can be: the iOS multitasking bar does not contain "a list of all running apps". It contains "a list of recently used apps". The user never has to manage background tasks on iOS. 首先我们得搞清楚的是, iOS 中所谓的「后台驻留」并不是指「执行中的程序」,而是「最近使用过的程序」 ,也可以瞧瞧Apple 的知识库文章怎么写的: 按两下主画面按钮后,显示的是「最近用过的应用程序」,所以别把它想成Mac OS X 中的Command + Tab 键所显示的切换程序列;你可以试试看将iPhone 关机再开机,然后按两下Home 键,应该会发现先前那些程式还是出现在那里,因为它其实是你最近使用过的程序使用记录,或像是浏览器中的浏览记录)。 如果你一个一个去清除 "后台驻留" 的程序,就像是一笔一笔删除浏览记录中的项目一样,是没有太大意义的(除非你不想让其他人看到你曾经用过什么程式,或者想杀时间、太无聊了),也不会对电力或记忆体有什么帮助。 iOS 的多任务处理其实是很聪明的

java播放背景音乐的几种方式

我与影子孤独终老i 提交于 2020-03-29 12:47:47
  大四第一学期快结束了,准备找实习单位的时候,用了一周的时间去投简历去面试,结果没有一家有反馈要不就是面试没通过,拿着iOS的项目(在老师工作室的外包项目)去面试java开发,结果全部碰壁。       第一种,直接在html上写 < div id = "playMusic" align = "center" style ="position : absolute ; right : 0px ; top : 0px ;" >//div的位置属性等    < audio src =" ${ctx}/BackgroundMusic/4.wav" controls ="controls" autoplay ="autoplay" loop =true >//src要写项目的音频文件不是网络上的     Your browser does not support the audio tag. / / 这是 浏览器 不支持的情况下所显示的文字    </audio > </div > 具体属性看http://www.w3school.com.cn/tags/tag_audio.asp    第二种在js上写 function playMusic(){   var audio = document.createElement('audio');   audio.src = '${ctx}

录音功能格式确认

ε祈祈猫儿з 提交于 2020-03-29 12:14:09
音频格式测试 录音最终发布,需要确定一个格式统一的音频格式。参考了网上介绍。 一、iOS 录音功能支持格式 主要的录音格式包括: (1)mp3: ios,android录制都 需要进行编码转换,使用lame第三方库,播放应该都可以直接播放 (2)iLBC:ios支持编码解码, android 低版本不支持,不过有开源第三方库,可以进行录制编码,播放解码的处理 (3)Speex:也是开源的第三方库,声称文件小,能降噪,需要ios,android客户端都进行编码解码处理 (4)amr:ios 4.3之前的版本支持,以后版本都不支持amr格式,android设备支持该格式,采用这种格式,ios设备可用libOpenCore第三方库进行转换,播放时再进行解码成原始pcm进行播放。android设备可直接录制与播放。压缩比较大,质量较差,多用于人声,通话录音。 (5)aac:两系统应该都支持的格式,但有说android设备有支持的不够好。比mp3音质更佳,文件更小;iOS 和 Android SDK 4.1.2(API 16 )及以上版本支持播放 。 (6) CAF : Core Audio Format (CAF) 是Mac OS X 原本支持的众多音频格式中最新增加的一种。Core Audio Format 由苹果电脑公司开发,将无限大的容量与对元数据的丰富支持结合在一个最优化音频的包中

extract audio in MP3 format from video in android

与世无争的帅哥 提交于 2020-03-28 06:41:08
问题 I want to convert a video file to mp3 file in android. I am using the below code to convert video to MP3: File source = new File(sourceFile); File target = new File(destFile); audioAttributes = new AudioAttributes(); audioAttributes.setCodec("libmp3lame"); audioAttributes.setBitRate(new Integer(128000)); audioAttributes.setChannels(new Integer(2)); audioAttributes.setSamplingRate(new Integer(44100)); EncodingAttributes encodingAttributes = new EncodingAttributes(); encodingAttributes

Is it possible to splice advertisements or messages dynamically into an MP3 file via a standard GET request?

随声附和 提交于 2020-03-26 05:21:24
问题 Say you have an MP3 file and it's 60,000,000 bytes, and you also have an MP3 advertisement that's 500,000 bytes, both encoded at the same bit rate. Would it be possible using an nginx or apache module to change the MP3 "Content-Length" header value to 60,500,000 and then control the incoming "Content-Range" requests so the first 500,000 bytes return the advertisement audio, and any range request greater than 500,000 begins returning the regular audio file with a 500,000 byte offset? Or is it

Is it possible to splice advertisements or messages dynamically into an MP3 file via a standard GET request?

我们两清 提交于 2020-03-26 05:20:50
问题 Say you have an MP3 file and it's 60,000,000 bytes, and you also have an MP3 advertisement that's 500,000 bytes, both encoded at the same bit rate. Would it be possible using an nginx or apache module to change the MP3 "Content-Length" header value to 60,500,000 and then control the incoming "Content-Range" requests so the first 500,000 bytes return the advertisement audio, and any range request greater than 500,000 begins returning the regular audio file with a 500,000 byte offset? Or is it

HTML5的几大新特性

十年热恋 提交于 2020-03-26 04:12:46
为了更好地处理今天的互联网应用,HTML5添加了很多新元素及功能,比如: 图形的绘制,多媒体内容,更好的页面结构,更好的形式 处理,和几个api拖放元素,定位,包括网页 应用程序缓存,存储,网络工作者等 1、语义标签化 语义化标签使得页面的内容结构化,见名知义 标签 描述 <hrader></header> 定义了文档的头部区域 <footer></footer> 定义了文档的尾部区域 <nav></nav> 定义文档的导航 <section></section> 定义文档中的节(section、区段) <article></article> 定义页面独立的内容区域 <aside></aside> 定义页面的侧边栏内容 <detailes></detailes> 用于描述文档或文档某个部分的细节 <summary></summary> 标签包含 details 元素的标题 <dialog></dialog> 定义对话框,比如提示框 2、增强型表单 HTML5 拥有多个新的表单 Input 输入类型。这些新特性提供了更好的输入控制和验证 输入类型 描述 color 主要用于选取颜色 date 从一个日期选择器选择一个日期 datetime 选择一个日期(UTC 时间) datetime-local 选择一个日期和时间 (无时区) email 包含 e-mail 地址的输入域