Comments (3)
Well I thought of one optimization while eating dinner. I bypassed a Marshal.Copy. By using a byte array to store the resampled sound data instead of a byte pointer. I didn't realize I could use fixed to point to the array.
fixed (byte* tmp = &_convertedData[0])
{
outSamples = ffmpeg.swr_convert(ResampleContext, &tmp, ResampleFrame->nb_samples, null, 0);
}
So it skips the whole convert byte* to byte[] bit. Might be able to do more of that in some other spots.
from openviii-monogame.
On saturday night I did some small optimization. I minimized some coping to buffer. I put all the needed header data into a byte[]. So it's ready to go and just need to send it to ffcc. with the info of where the data is in the data file and the data file's name. On the step where it reads from the file it only reads enough to fill the buffer for ffmpeg and closes the file.
--edit--
This Introduced a crash that only happened when running through the audio channels. But it's fixed. Just had to Dispose before leaving fixed.
from openviii-monogame.
So we got threading last week. And increased the buffer to 100 chunks of samples. That seemed to help. I thought of another change to make when I'm home.
I can track how many samples are sent to the audio buffer, subtract the precached buffer, divide that by sample rate. And that gives us the seconds of audio sent to buffer. I think I can use that to detect if video got ahead of the audio. And basically pause the video till audio catches up.
There might be a need to check number of chunks in the buffer. But I don't know if all chunks will always be 32 samples.
If you resize the window during playback it's an easy way to force this to happen.
from openviii-monogame.
Related Issues (20)
- Menu Strings in Other Languages don't line up with English. HOT 1
- Noise in pngs will show in openviii. HOT 5
- Unit tests and OpenVIII HOT 12
- Laguna's team member names. HOT 4
- Coding style HOT 3
- Laguna costume settings. Unsure. HOT 1
- Battle Camera shakes at end of animation. HOT 4
- world collision - unable to leave some forests
- iOS / macOS HOT 7
- Need to be GPLv3 HOT 1
- build on a Pi4 HOT 2
- Possible translation fix in FF8-Remastered. HOT 1
- Need unit tests HOT 1
- Linux game path finding is just awful HOT 3
- Enable GitHub Discussions HOT 1
- question cdda pc2000 HOT 1
- Setup Code Scanning?
- Can't get project to build using latest Master. HOT 4
- Issue in Installing Windows HOT 2
- Info Needed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openviii-monogame.