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
3b2e06a7
Commit
3b2e06a7
authored
Dec 28, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WebAudio: Optimizations to some JavaScript code.
Public issue
https://github.com/mackron/miniaudio/issues/384
parent
d3d4d425
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
miniaudio.h
miniaudio.h
+10
-5
No files found.
miniaudio.h
View file @
3b2e06a7
/*
/*
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
miniaudio - v0.11.
1 - 2021-12-27
miniaudio - v0.11.
2 - TBD
David Reid - mackron@gmail.com
David Reid - mackron@gmail.com
...
@@ -3627,7 +3627,7 @@ extern "C" {
...
@@ -3627,7 +3627,7 @@ extern "C" {
#define MA_VERSION_MAJOR 0
#define MA_VERSION_MAJOR 0
#define MA_VERSION_MINOR 11
#define MA_VERSION_MINOR 11
#define MA_VERSION_REVISION
1
#define MA_VERSION_REVISION
2
#define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION)
#define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION)
#if defined(_MSC_VER) && !defined(__clang__)
#if defined(_MSC_VER) && !defined(__clang__)
...
@@ -37024,7 +37024,7 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d
...
@@ -37024,7 +37024,7 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d
how well this would work. Although ScriptProccessorNode is deprecated, in practice it seems to have pretty good browser support so I'm leaving it like
how well this would work. Although ScriptProccessorNode is deprecated, in practice it seems to have pretty good browser support so I'm leaving it like
this for now. If anyone knows how I could get raw PCM data using the MediaRecorder API please let me know!
this for now. If anyone knows how I could get raw PCM data using the MediaRecorder API please let me know!
*/
*/
device.scriptNode = device.webaudio.createScriptProcessor(bufferSize,
channels,
channels);
device.scriptNode = device.webaudio.createScriptProcessor(bufferSize,
(isCapture) ? channels : 0, (isCapture) ? 0 :
channels);
if (isCapture) {
if (isCapture) {
device.scriptNode.onaudioprocess = function(e) {
device.scriptNode.onaudioprocess = function(e) {
...
@@ -37032,7 +37032,7 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d
...
@@ -37032,7 +37032,7 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d
return; /* This means the device has been uninitialized. */
return; /* This means the device has been uninitialized. */
}
}
if(device.intermediaryBufferView.length == 0) {
if
(device.intermediaryBufferView.length == 0) {
/* Recreate intermediaryBufferView when losing reference to the underlying buffer, probably due to emscripten resizing heap. */
/* 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);
device.intermediaryBufferView = new Float32Array(Module.HEAPF32.buffer, device.intermediaryBuffer, device.intermediaryBufferSizeInBytes);
}
}
...
@@ -37130,8 +37130,10 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d
...
@@ -37130,8 +37130,10 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d
}
}
} else {
} else {
for (var iChannel = 0; iChannel < e.outputBuffer.numberOfChannels; ++iChannel) {
for (var iChannel = 0; iChannel < e.outputBuffer.numberOfChannels; ++iChannel) {
var outputBuffer = e.outputBuffer.getChannelData(iChannel);
var intermediaryBuffer = device.intermediaryBufferView;
for (var iFrame = 0; iFrame < framesToProcess; ++iFrame) {
for (var iFrame = 0; iFrame < framesToProcess; ++iFrame) {
e.outputBuffer.getChannelData(iChannel)[totalFramesProcessed + iFrame] = device.intermediaryBufferView
[iFrame*channels + iChannel];
outputBuffer[totalFramesProcessed + iFrame] = intermediaryBuffer
[iFrame*channels + iChannel];
}
}
}
}
}
}
...
@@ -89126,6 +89128,9 @@ There have also been some other smaller changes added to this release.
...
@@ -89126,6 +89128,9 @@ There have also been some other smaller changes added to this release.
/*
/*
REVISION HISTORY
REVISION HISTORY
================
================
v0.11.2 - TBD
- WebAudio: Optimizations to some JavaScript code.
v0.11.1 - 2021-12-27
v0.11.1 - 2021-12-27
- Result codes are now declared as an enum rather than #defines.
- Result codes are now declared as an enum rather than #defines.
- Channel positions (MA_CHANNEL_*) are now declared as an enum rather than #defines.
- Channel positions (MA_CHANNEL_*) are now declared as an enum rather than #defines.
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