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 {
65
65
/// Ideally the load value is below 1.0, meaning that it took less time to render the audio than it
66
66
/// took to play it out. An audio buffer underrun happens when this load value is greater than 1.0: the
67
67
/// system could not render audio fast enough for real-time.
68
+ #[ derive( Clone ) ]
68
69
pub struct AudioRenderCapacity {
69
70
context : ConcreteBaseAudioContext ,
70
71
receiver : Receiver < AudioRenderCapacityLoad > ,
Original file line number Diff line number Diff line change @@ -268,6 +268,12 @@ impl AudioContext {
268
268
self . backend_manager . lock ( ) . unwrap ( ) . sink_id ( ) . to_owned ( )
269
269
}
270
270
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
+
271
277
/// Update the current audio output device.
272
278
///
273
279
/// The provided `sink_id` string must match a device name `enumerate_devices_sync`.
@@ -712,12 +718,6 @@ impl AudioContext {
712
718
let opts = node:: MediaElementAudioSourceOptions { media_element } ;
713
719
node:: MediaElementAudioSourceNode :: new ( self , opts)
714
720
}
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
- }
721
721
}
722
722
723
723
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments