File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ impl AudioRenderCapacityEvent {
6565/// Ideally the load value is below 1.0, meaning that it took less time to render the audio than it
6666/// took to play it out. An audio buffer underrun happens when this load value is greater than 1.0: the
6767/// system could not render audio fast enough for real-time.
68+ #[ derive( Clone ) ]
6869pub struct AudioRenderCapacity {
6970 context : ConcreteBaseAudioContext ,
7071 receiver : Receiver < AudioRenderCapacityLoad > ,
Original file line number Diff line number Diff line change @@ -268,6 +268,12 @@ impl AudioContext {
268268 self . backend_manager . lock ( ) . unwrap ( ) . sink_id ( ) . to_owned ( )
269269 }
270270
271+ /// Returns an [`AudioRenderCapacity`] instance associated with an AudioContext.
272+ #[ must_use]
273+ pub fn render_capacity ( & self ) -> AudioRenderCapacity {
274+ self . render_capacity . clone ( )
275+ }
276+
271277 /// Update the current audio output device.
272278 ///
273279 /// The provided `sink_id` string must match a device name `enumerate_devices_sync`.
@@ -712,12 +718,6 @@ impl AudioContext {
712718 let opts = node:: MediaElementAudioSourceOptions { media_element } ;
713719 node:: MediaElementAudioSourceNode :: new ( self , opts)
714720 }
715-
716- /// Returns an [`AudioRenderCapacity`] instance associated with an AudioContext.
717- #[ must_use]
718- pub fn render_capacity ( & self ) -> & AudioRenderCapacity {
719- & self . render_capacity
720- }
721721}
722722
723723#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments