BlackBerry Application Development Guide using audio

Source: Internet
Author: User

This article is the fourth part of the BlackBerry Application Development Guide-using audio.

Play a supported audio format tune

On BlackBerry devices that support standard audio formats, you can play audio files in one of the following formats:

◆ Audio/MPEG-1 Layer 3

◆ Audio/midi

◆ Audio/x-midi

◆ Audio/mid

BlackBerry devices use the Mobile Media APIjavax. microedition. media package to support standard audio file formats.

To determine the supported audio format at runtime, Call Manager. getSupportedContentTypes ()..

Voice Recording API

In the net. rim. device. api. system package, the voice recording API consists of the following three methods:

◆ Audio. playFile (int audioCodec, int fs, String fileName)

◆ Audio. recordFile (int audioCodec, int fs, String fileName)

◆ Audio. stopFile (int audioCodec, int fs, String fileName)

Each method accepts an encoding, a file system, and a file name. Audio Recording encoding is performed by Audio. AUDIO_CODEC_VOICENOTE. The iDEN file system is represented by net. rim. device. api. io. FILESYSTEM_PATRIOT. A file system is a common file system. Therefore, a file name parameter consists of a file name without a path name. When the recording, playback, or stop operation fails or is completed, the application should register an audio listener to receive these messages.

To register a listener, implement net. rim. device. api. system. AudioFileListener. Register by calling Audio. addListener (Application, AudioListener.

Note: the size of the file system is about KB, which restricts the recording length. The size is about 8 to 9 seconds. If the recording size exceeds the file system size, the recording will stop and save the file .)

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.