Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
56d22ae3
Commit
56d22ae3
authored
Nov 12, 2020
by
Thehink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recreate intermediaryBufferView if we lost ref
parent
2e1e2ff8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
miniaudio.h
miniaudio.h
+10
-0
No files found.
miniaudio.h
View file @
56d22ae3
...
@@ -31283,6 +31283,11 @@ static ma_result ma_device_init_by_type__webaudio(ma_context* pContext, const ma
...
@@ -31283,6 +31283,11 @@ static ma_result ma_device_init_by_type__webaudio(ma_context* pContext, const ma
return; /* This means the device has been uninitialized. */
return; /* This means the device has been uninitialized. */
}
}
if(device.intermediaryBufferView.length == 0) {
/* Recreate intermediaryBufferView when losing reference to the underlying buffer, probably due to emscripten resizing heap. */
device.intermediaryBufferView = new Float32Array(Module.HEAPF32.buffer, device.intermediaryBuffer, device.intermediaryBufferSizeInBytes);
}
/* Make sure silence it output to the AudioContext destination. Not doing this will cause sound to come out of the speakers! */
/* Make sure silence it output to the AudioContext destination. Not doing this will cause sound to come out of the speakers! */
for (var iChannel = 0; iChannel < e.outputBuffer.numberOfChannels; ++iChannel) {
for (var iChannel = 0; iChannel < e.outputBuffer.numberOfChannels; ++iChannel) {
e.outputBuffer.getChannelData(iChannel).fill(0.0);
e.outputBuffer.getChannelData(iChannel).fill(0.0);
...
@@ -31343,6 +31348,11 @@ static ma_result ma_device_init_by_type__webaudio(ma_context* pContext, const ma
...
@@ -31343,6 +31348,11 @@ static ma_result ma_device_init_by_type__webaudio(ma_context* pContext, const ma
return; /* This means the device has been uninitialized. */
return; /* This means the device has been uninitialized. */
}
}
if(device.intermediaryBufferView.length == 0) {
/* Recreate intermediaryBufferView when losing reference to the underlying buffer, probably due to emscripten resizing heap. */
device.intermediaryBufferView = new Float32Array(Module.HEAPF32.buffer, device.intermediaryBuffer, device.intermediaryBufferSizeInBytes);
}
var outputSilence = false;
var outputSilence = false;
/* Sanity check. This will never happen, right? */
/* Sanity check. This will never happen, right? */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment