Home | History | Annotate | Download | only in soundpool

Lines Matching defs:Sample

210     sp<Sample> sample = new Sample(++mNextSampleID, path);
211 mSamples.add(sample->sampleID(), sample);
212 doLoad(sample);
213 return sample->sampleID();
221 sp<Sample> sample = new Sample(++mNextSampleID, fd, offset, length);
222 mSamples.add(sample->sampleID(), sample);
223 doLoad(sample);
224 return sample->sampleID();
227 void SoundPool::doLoad(sp<Sample>& sample)
229 LOGV("doLoad: loading sample sampleID=%d", sample->sampleID());
230 sample->startLoad();
231 mDecodeThread->loadSample(sample->sampleID());
246 sp<Sample> sample;
255 // is sample ready?
256 sample = findSample(sampleID);
257 if ((sample == 0) || (sample->state() != Sample::READY)) {
258 LOGW(" sample %d not READY", sampleID);
276 channel->play(sample, channelID, leftVolume, rightVolume, priority, loop, rate);
453 Sample::Sample(int sampleID, const char* url)
461 Sample::Sample(int sampleID, int fd, int64_t offset, int64_t length)
471 void Sample::init()
484 Sample::~Sample()
486 LOGV("Sample::destructor sampleID=%d, fd=%d", mSampleID, mFd);
495 status_t Sample::doLoad()
511 LOGE("Unable to load sample: %s", mUrl);
518 LOGE("Sample rate (%u) out of range", sampleRate);
523 LOGE("Sample channel count (%d) out of range", numChannels);
547 void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftVolume,
559 this, sample->sampleID(), nextChannelID, leftVolume, rightVolume,
565 mNextEvent.set(sample, nextChannelID, leftVolume, rightVolume, priority, loop, rate);
580 int numChannels = sample->numChannels();
581 uint32_t sampleRate = uint32_t(float(sample->sampleRate()) * rate + 0.5);
587 frameCount = sample->size()/numChannels/
588 ((sample->format() == AUDIO_FORMAT_PCM_16_BIT) ? sizeof(int16_t) : sizeof(uint8_t));
592 // Ensure minimum audio buffer size in case of short looped sample
608 // do not create a new audio track if current track is compatible with sample parameters
610 newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
611 channels, sample->getIMemory(), 0, callback, userData);
613 newTrack = new AudioTrack(streamType, sampleRate, sample
630 mSample = sample;
655 sp<Sample> sample;
672 sample = mNextEvent.sample();
681 play(sample, nextChannelID, leftVolume, rightVolume, priority, loop, rate);
710 sp<Sample> sample = mSample;
724 if (sample != 0) {
729 if (mPos < (int)sample->size()) {
730 uint8_t* p = sample->data() + mPos;
731 count = sample->size() - mPos;
894 void SoundEvent::set(const sp<Sample>& sample, int channelID, float leftVolume,
897 mSample = sample;