public class Audio extends Object
Constructor and Description |
---|
Audio(android.content.Context context,
int resourceId,
PcmFormat pcmFormat)
Create an Audio from an Android resource.
|
Audio(android.content.Context context,
android.net.Uri uri,
PcmFormat pcmFormat)
Create an Audio from a Uri pointing to a location on the filesystem.
|
public Audio(android.content.Context context, int resourceId, PcmFormat pcmFormat)
context
- The application context.resourceId
- The resource ID for the audio file.pcmFormat
- The format of the audio data.public Audio(android.content.Context context, android.net.Uri uri, PcmFormat pcmFormat)
context
- The application context.uri
- The Uri from which the audio will be loaded.
For example:
Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getPackageName() + "/" + R.raw.boston_ma);
or
Uri uri = Uri.parse(ContentResolver.SCHEME_FILE + ":///storage/sdcard0/Download/boston_ma.pcm16k");pcmFormat
- The format of the audio data.