In Android development we often use MediaPlayer to play audio files, but MediaPlayer there are some shortcomings, such as: high resource consumption, long delay time, does not support multiple audio simultaneous playback and so on. These shortcomings have determined that the use of MediaPlayer in certain situations will not be ideal, for example in game development where time accuracy is a relatively high requirement.This article address: http://www.c
The directory file is the upper card module that handles the ISA sound card.SOUND/ARM,SOUND/PPC, and Sound/sparc here are some of the top-level card modules associated with chip architectures.Sound/usb This directory contains some usb-audio drivers.The Sound/pcmcia PCCard drive will be put here. The CardBus driver wil
Android Play sound, one is Soundpool, one is MediaPlayerSoundpool is suitable for playback of sound effects that reflect high speed requirements, such as in-game explosion soundMediaplay for longer sound effects, such as in-game background musicLet's do an example, one is Chang.ogg, the other is duan.wav.These two
This example describes the Android implementation that directly plays the sound captured by the microphone. Share to everyone for your reference. Specifically as follows:
This is a direct playback microphone captured by the voice thread class:
Class Recordthread extends thread{static final int frequency = 44100;
static final int channelconfiguration = Audioformat.channel_configuration_mono;
static
Chapter 2 music and sound effects
The advertisement says "there is no sound, no sound, no matter how good it is". Let's add the sound effect to the program.
In general, the game sounds are divided into two parts: music and sound. The intuitive difference is that the playing
Today, I saw an application pop-up toast, and it seems pretty good to have a sound. I said you don't have to fight, so come and say toast.
No,CodeOffer:
Package Weibo. lixiaodaoaaa. view; import Weibo. lixiaodaoaaa. UI. r; import android. content. context; import android. media. mediaplayer; import android. util.
In Android, there are two ways to play sound, one through MediaPlayer and the other through Soundpool. The former is mainly used for playing long-time music, while the latter is used to play a small segment of the sound effects, such as the key tone, the advantage is that the resource occupies a small, while being able to load multiple
There are unwritten rules in the industry that phone companies must have a prompt when they click the photo and video keys for camera. Therefore, google also put the function of playing the photo sound in the cameraService to prevent developers from developing a non-audible camera. Therefore, as long as the camera function is called, it will surely sound, this is written to the framework.
This rule is a bi
There are unwritten rules in the industry that phone companies must have a prompt when they click the photo and video keys for camera. Therefore, google also put the function of playing the photo sound in the cameraService to prevent developers from developing a non-audible camera. Therefore, as long as the camera function is called, it will surely sound, this is written to the framework.This rule is a bit
Android sound SoundPool: soundpool 1 not retry
SoundPool is used in development today. When soundpool 1 not retry cannot play the sound, MediaPlay can
After some research, we found that:
Unable to play the sound because of the soundpool 1 not retry error code
Mgr = (AudioManager) MainActivity. this. getSystemService
In the Android system, there are two ways to play sound, one is through MediaPlayer, and the other is through SoundPool. The former is mainly used to play music for a long period of time, while the latter is used to play sound effects for a short period of time, such as the key tone. Its advantage is that the resource usage is small and multiple
Description
Implementation features:
(1) The right part of the screen slide, the sound becomes big, down, the sound becomes small screen left half of the slide, brightness, decline, brightness becomes small
(2) If the brightness >1 or less than 0.2, the mobile phone vibration
Private float starty;//Record the y-coordinate of the finger pressed private float startx;//record the y-coordinate when the
(1) Project IntroductionAudiomanager in the Android API, it provides a way to adjust the phone volume.Audioma.adjustvolume (audiomanager.adjust_lower, 0);Audioma.adjustvolume (audiomanager.adjust_raise, 0);can also adjust the phone's sound mode to vibrate or muteAudioma.setringermode (Audiomanager.ringer_mode_normal);Audioma.setringermode (audiomanager.ringer_mode_silent);Audioma.setringermode (audiomanager
Android sound focus ---- adjust the volume of Music from Music back to Luncher
Sound types are defined in the AudioSystem. java file.
/* The default audio stream */public static final int STREAM_DEFAULT = -1;/* The audio stream for phone calls */public static final int STREAM_VOICE_CALL = 0;/* The audio stream for system sounds */public static final int STREAM_S
" Android:textcolor= "#ffffffff"/>Icon1″android:layout_width="Wrap_content" Android:layout_height="Wrap_content" Android:layout_marginright= "10dip"/>Use default values where applicable describes the method of using default sounds, vibrations, or both:int default = notification.default_sound; // Notification.default_sound // notification.default_vibrate // Notification.default_all = defaults;Note: The same notification id:r.layout.status_bar_notifications is used in the example, so each call to
of mediarecorder, and call mediarecorder. getmaxamplder () through a thread ();
The obtained is the maximum instantaneous amplitude, which is expressed by multiplying the logarithm by 10.
Finally, it should be noted that the hardware customized by Android mobile phone manufacturers is different, so the value obtained by MIC can only be "characterized", and cannot be taken as the real basis. Although they are smart phones, they are still mobile phones
; Normally in the audio and video interface to adjust the volume of the stream is Stream_music, back to luncher adjust is stream_voice_call, but this switch a little delay streamoverride.sdelayms, resulting in the exit tone, After the video interface is adjusted immediately, the change is still the size of the Stream_music:You can modify the/frameworks/base/media/java/android/media/audioservice.java file /** * For code clarity for Getactivestreamtype
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.