pcm

硬件_WIFI&Blue

匿名 (未验证) 提交于 2019-12-02 23:56:01
WIFI 平台:全志 模组:AP6210 (WF BT FM) 模式:STA  AP  Wi-Fi Direct(点对点) PCM数字音频接口,说明接口传输的音频数据是通过PCM方式采样得到的,区别于PDM形式;IIS传输的也是PCM类型数据,属于其一个特例。 相比于IIS,PCM接口更加灵活,通过时分复用TDM方式,PCM接口支持多大N个声道的数据;TDM不像IIS有统一标准,不同厂家TDM时有差异。 Wi-Fi Direct技术是Wi-Fi产业链向蓝牙技术发起的挑战,它试图完全取代蓝牙 Wi-Fi Direct是一种点对点连接技术,它可以在两台station之间直接建立tcp/ip链接,并不需要AP的参与;其中一台station会起到传统意义上的AP的作用,称为Group Owner(GO),另外一台station则称为Group Client(GC),像连接AP一样连接到GO。GO和GC不仅可以是一对一,也可以是一对多 Wi-Fi Direct和传统wifi技术并不是互斥的:GO可以可以像AP一样为几台GC提供服务;它同时可以像传统的station一样,连接到某个AP;它同时自己也可以是一个AP,想象下这种使用场景:手机连接到某AP上网,运行youtube客户端看视频;手机同时通过Wi-Fi Direct连接到电视,将视频通过Wi-Fi Direct Display

第17章Linux音频设备驱动之Linux ASoC音频设备驱动

匿名 (未验证) 提交于 2019-12-02 21:59:42
17.5 Linux ASoC音频设备驱动 17.5.1 ASoC(ALSA System on Chip) 驱动的组成 ASoC(ALSA System on Chip) 是 ALSA 在 SoC 方面的发展和演变,ASoC在本质上仍然属于ALSA,但是在 ALSA 架构基础上对 CPU 相关的代码和 Codec 相关的代码进行分离。其原因是,采用传统 ALSA 架构的情况下,同一型号的 Codec 工作于不同的 CPU 时,需要不同的驱动,这不符合代码重用的要求。 对于目前嵌入式系统上的 声卡驱动 开发,建议读者尽量采用 ASoC 框架 ,ASoC 主要由 3 部分组成。 (1) Codec 驱动 。这一部分只关心 Codec 本身,与 CPU 平台相关的特性不由此部分操作。 (2) 平台驱动 。这一部分只关心 CPU 本身,不关心 Codec。主要处理两个问题:DMA 引擎和 SoC 集成的 PCM、I 2 S 或 AC 97 数字接口控制。 (3) 板驱动(称为 machine 驱动) 。这一部分将平台驱动和 Codec 驱动绑定在一起,描述板一级的硬件特征。 在以上 3 部分中,1 和 2 基本都可以仍然是通用的驱动,Codec 驱动认为自己可以连接任意 CPU,而 CPU 的 I 2 S、PCM 或 AC 97 接口对应的平台驱动则认为自己可以连接任意符合其接口类型的

How to extract frequency out of WAV sample data?

醉酒当歌 提交于 2019-12-02 21:18:06
I'm developing an application in c to read simple PCM WAV files. My question is, how should I interpret the samples from the data chunk, so that I can extract the sample's frequency? Given a WAV example, how can the original data represent frequencies. E.g. this data chunk, 24 17 1e f3, for stereo, 16 bits, the left channel sample is, 0x1724 = 5924d, means 5924Hz ? How can that be, for samples that are signed or frequencies that humans can´t hear? AShelly Your assumption is incorrect. The sample data is simply a digital representation of the actual sound wave. The numbers represent wave

Mixing 16 bit linear PCM streams and avoiding clipping/overflow

廉价感情. 提交于 2019-12-02 18:53:48
I've trying to mix together 2 16bit linear PCM audio streams and I can't seem to overcome the noise issues. I think they are coming from overflow when mixing samples together. I have following function ... short int mix_sample(short int sample1, short int sample2) { return #mixing_algorithm#; } ... and here's what I have tried as #mixing_algorithm# sample1/2 + sample2/2 2*(sample1 + sample2) - 2*(sample1*sample2) - 65535 (sample1 + sample2) - sample1*sample2 (sample1 + sample2) - sample1*sample2 - 65535 (sample1 + sample2) - ((sample1*sample2) >> 0x10) // same as divide by 65535 Some of them

PCM to AAC conversion using mediacodec

岁酱吖の 提交于 2019-12-02 18:11:02
I am using a media codec class in Android (Jelly Bean) to encode PCM format to AAC. The file was encoded but no music player is able to play that file. I was not able to find any working code or proper documentation on the net. This is my code: public void doConvert() { new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { try { int codecCount = MediaCodecList.getCodecCount(); for ( int i=0; i < codecCount; i++) { MediaCodecInfo info = MediaCodecList.getCodecInfoAt(i); Logger.getLogger(MainActivity.class.getSimpleName()).log(Level.INFO, info.getName());

How to convert sample rate from AV_SAMPLE_FMT_FLTP to AV_SAMPLE_FMT_S16?

一笑奈何 提交于 2019-12-02 16:01:12
I am decoding aac to pcm with ffmpeg with avcodec_decode_audio3. However it decodes into AV_SAMPLE_FMT_FLTP sample format (PCM 32bit Float Planar) and i need AV_SAMPLE_FMT_S16 (PCM 16 bit signed - S16LE). I know that ffmpeg can do this easily with -sample_fmt. I want to do the same with the code but i still couldn't figure it out. audio_resample did not work for: it fails with error message: .... conversion failed. EDIT 9th April 2013 : Worked out how to use libswresample to do this... much faster! At some point in the last 2-3 years FFmpeg's AAC decoder's output format changed from AV_SAMPLE

ue4 播放程序化生成的声音

别等时光非礼了梦想. 提交于 2019-12-02 15:34:14
首先了解音频有几个重要的概念: 采样频率 : 每秒钟采样次数, 采样率越高,数字波形的形状越接近原始模拟波形,通常的采用频率有22050,44100,48000,96000 采样位数 : 采样声波时,为每个采样指定最接近原始声波振幅的振幅值。 采样位数提高可提供更多可能的振幅值,产生更大的动态范围、更低的噪声基准和更高的保真度。通常的采样位数有8bit,16bit,24bit,32bit。 通道数 : 即 声音的通道 的数目 。常有单声道和立体声之分,单声道的声音只能使用一个喇叭发声(有的也处理成两个喇叭输出同一个声道的声音),立体声可以使两个喇叭都发声(一般左右声道有分工) ,更能感受到空间效果,当然还有更多的通道数。 PCM : PCM(Pulse Code Modulation----脉码调制录音)。所谓PCM录音就是将声音等模拟信号变成符号化的脉冲列,再予以记录。PCM信号是由[1]、[0]等符号构成的数字信号,而未经过任何编码和压缩处理。与模拟信号比,它不易受传送系统的杂波及失真的影响。动态范围宽,可得到音质相当好的影响效果。 WAV: wav是一种无损的音频文件格式,WAV符合 PIFF(Resource Interchange File Format)规范。所有的WAV都有一个文件头,这个文件头音频流的编码参数。WAV对音频流的编码没有硬性规定,除了PCM之外

AudioTrack: should I use an Asynctask, a Thread or a Handler?

社会主义新天地 提交于 2019-12-02 13:26:03
In Android: I am trying to play a wav file of size 230mb and 20 min whose properties are as below: ffmpeg -i 1.wav Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s The following is the code in android: float volchange=0.5f; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Code to set the volume change variable for the audiotrack Button volup = (Button) findViewById(R.id.volup); Button voldown = (Button) findViewById(R.id.voldown); volup.setOnClickListener(new View

audio write pcm ioctl - SNDRV_PCM_IOCTL_WRITEI_FRAMES

痴心易碎 提交于 2019-12-02 12:50:09
http://androidxref.com/9.0.0_r3/xref/external/tinyalsa/pcm.c#535 http://androidxref.com/kernel_3.18/xref/sound/core/pcm_native.c#2745 https://blog.csdn.net/Vincentywj/article/details/77849442 对于回放的情形,PCM 数据流向大致是: copy_from_user DMA I2S DAC ^ ^ ^ ^ +---------+ | +----------+ | +-----------+ | +-----+ | +------+ |userspace+-------->DMA Buffer+------->I2S TX FIFO+------->CODEC+------->SPK/HP| +---------+ +----------+ +-----------+ +-----+ +------+ 来源: https://blog.csdn.net/chenqiang0721/article/details/102761326

ALSA 音频工具 amixer、aplay、arecord

半腔热情 提交于 2019-12-02 09:27:12
ALSA 简介   ALSA 是 Advanced Linux Sound Architecture,高级 Linux 声音架构的简称,它在 Linux 操作系统上提供了音频和 MIDI(Musical Instrument Digital Interface,音乐设备数字化接口)的支持。在2.6系列内核中,ALSA 已经成为默认的声音子系统,用来替换2.4系列内核中的 OSS(Open Sound System,开放声音系统)。   ALSA 的主要特性包括:高效地支持从消费类入门级声卡到专业级音频设备所有类型的音频接口,完全模块化的设计, 支持对称多处理(SMP)和线程安全,对 OSS 的向后兼容,以及提供了用户空间的 alsa-lib 库来简化应用程序的开发。   想了解更多的关于 ALSA 的这一开源项目的信息和知识,请查看:http://www.alsa-project.org/。 ALSA 音频工具编译安装 1、官网 http://www.alsa-project.org 下载 alsa-lib 和 alsa-utils。 例如:alsa-lib-1.0.27.2.tar.bz2 和 alsa-utils-1.0.27.2.tar.bz2 2、创建 alsa 安装目录(如 /home/rudy/alsa 目录),并在该目录下创建 install 目录,接着把压缩包拷到