class Sound
Defined at line 18 of file ../../src/media/sounds/soundplayer/sound.h
Base class for |UndiscardableSound| and |DiscardableSound|, both containers for sound that
wrap a VMO containing raw LPCM audio content.
Public Methods
void ~Sound ()
Defined at line 20 of file ../../src/media/sounds/soundplayer/sound.h
const zx::vmo & LockForRead ()
Locks the sound VMO for reading, restoring its contents if it has been discarded. Locks may
be nested arbitrarily (with a mix of |LockForRead| and |LockForWrite|). Only the outermost
lock call has any effect aside from changing the nesting counter. There are no unexpected
side effects, but, of course, if the intent is to read valid data from the VMO, the VMO
should contain valid data.
Defined at line 26 of file ../../src/media/sounds/soundplayer/sound.cc
const zx::vmo & LockForWrite ()
Locks the sound VMO writing. If the VMO has been discarded, it is not restored. See the
comment for |LockForRead| above.
Defined at line 36 of file ../../src/media/sounds/soundplayer/sound.cc
uint64_t size ()
Size of the sound in the VMO.
Defined at line 37 of file ../../src/media/sounds/soundplayer/sound.h
uint64_t vmo_size ()
Size of the entire VMO.
Defined at line 40 of file ../../src/media/sounds/soundplayer/sound.h
const fuchsia::media::AudioStreamType & stream_type ()
Defined at line 42 of file ../../src/media/sounds/soundplayer/sound.h
void Unlock ()
Unlocks the sound after |LockForRead| or |LockForWrite|.
Defined at line 46 of file ../../src/media/sounds/soundplayer/sound.cc
zx::duration duration ()
Defined at line 54 of file ../../src/media/sounds/soundplayer/sound.cc
uint64_t frame_count ()
Defined at line 59 of file ../../src/media/sounds/soundplayer/sound.cc
uint32_t frame_size ()
Defined at line 61 of file ../../src/media/sounds/soundplayer/sound.cc
uint32_t sample_size ()
Defined at line 63 of file ../../src/media/sounds/soundplayer/sound.cc
Protected Methods
void Sound (zx::vmo vmo, uint64_t size, fuchsia::media::AudioStreamType stream_type)
Constructs a |Sound| from a non-discardable VMO.
Defined at line 21 of file ../../src/media/sounds/soundplayer/sound.cc
void ApplyLockForRead ()
Applies a lock for reading on behalf of |LockForRead|, which handles the nesting counter.
void ApplyLockForWrite ()
Applies a lock for reading on behalf of |LockForWrite|, which handles the nesting counter.
void Removelock ()
Removes a lock on behalf of |Unlock|, which handles the nesting counter.
void Sound ()
Defined at line 56 of file ../../src/media/sounds/soundplayer/sound.h
zx::vmo & vmo ()
Defined at line 58 of file ../../src/media/sounds/soundplayer/sound.h
void SetSize (size_t size, size_t vmo_size)
Defined at line 60 of file ../../src/media/sounds/soundplayer/sound.h
void SetStreamType (fuchsia::media::AudioStreamType stream_type)
Defined at line 65 of file ../../src/media/sounds/soundplayer/sound.h