webaudio: expose AudioContext in WebAudioStream (#659)
This commit is contained in:
parent
8d164ed585
commit
b1457e5945
1 changed files with 8 additions and 0 deletions
|
|
@ -350,6 +350,14 @@ impl DeviceTrait for Device {
|
|||
}
|
||||
}
|
||||
|
||||
impl Stream {
|
||||
/// Return the [`AudioContext`](https://developer.mozilla.org/docs/Web/API/AudioContext) used
|
||||
/// by this stream.
|
||||
pub fn audio_context(&self) -> &AudioContext {
|
||||
&*self.ctx
|
||||
}
|
||||
}
|
||||
|
||||
impl StreamTrait for Stream {
|
||||
fn play(&self) -> Result<(), PlayStreamError> {
|
||||
let window = web_sys::window().unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue