Comments (5)
Hi @KoertGaaikema I will close this issue as the original one has been resolved. If you can send me a message via the form on https://igorski.nl/contact we can have a look at your pitch shifting question :)
from mwengine.
Hi @KoertGaaikema , have you tried the introduction on sample based content in the Wiki: https://github.com/igorski/MWEngine/wiki/Example-:-Creating-a-simple-drum-machine ? What you need is an instance of SampledInstrument that can play back samples that are registered inside the SampleManager.
I am tempted to extend the example Activity in this repository though as I can see the benefit of including an example on working with sample based sequencing. Would you agree that adding a simple kick/snare pattern to the existing demo Activity could be of help ?
from mwengine.
Yes, I've got all of that set up !
And did read most of the wiki already :D
At the start of my app I copy all audio files to the local filesystem of my phone now , and load them from there ( not the nicest solution, but at least I can get to the files via JavaUtilities.createSampleFromFile )
The main error I get now is "WaveReader::Error not a valid WAVE file (no RIFF header)"
And I'm pretty sure it's a valid wav file ( I use the same files in a IOS app )
But I prefer to just load them from the assets folder directly.
It would be really helpful to add a working example indeed where you actually load wav files.
Much appreciated!
I'm purely working with the java side of the repo btw, since c++ is new to me ;)
Btw, to make the thing compile I had to add "-latomic" to line 81 of Android.mk
LOCAL_LDLIBS := -llog -lOpenSLES -latomic
Not sure if it only applies to my machine / setup though ...
K.
from mwengine.
Hello again!
I understand the issue. Depending on how you copied your resources it is possible the files aren't actual WAV files when they are copied onto the local filesystem as assets are compressed when packaged inside an .APK (unless you add them as a resource to the /res/raw folder).
However, it is obviously not ideal to have to copy your package contents onto the filesystem (and worry about the decompression as well). For this purpose, I have created a new function in JavaUtilities called createSampleFromAsset. This method allows you to pass the String name of the asset which will then be loaded directly from the APK's /assets folder (making it possible to use compression for your assets, which is nice, but also to not have to temporarily store data on the device's file system, which is even nicer).
This development is currently on this feature branch: https://github.com/igorski/MWEngine/tree/samples (which will eventually be merged via #23 when some refactoring issues have been resolved).
You can check the branch out and view MWEngineActivity.java for an example on how to use the new createSampleFromAsset-method (lines 139 onwards). I hope this also addresses the issue you had with the corrupt WAV file (try replacing one of the .wav files in the repository's /assets/ folder with your file to see if the issue is resolved).
I have also added your "-latomic" addition to the make files, it is a requirement for the new NDK.
from mwengine.
Cool !
It works like a charm !
Really straight forward now.
Thanks !
I've got one more question ( maybe a few more when I dive into it :D ) .
Is it possible to change rate / pitch of a SampledInstrument ?
So I can use a simple wav as an actual instrument and play different notes ?
K.
from mwengine.
Related Issues (20)
- Is it possible to remove effects after recorded the audio? HOT 7
- Bug with processingChain.removeProcessor(fx) HOT 2
- Error with processors HOT 2
- Is there possible to adjust the volume of latency or turn off those live voice feedback? HOT 7
- Issues with event.addToSequencer() while the sequencer is running HOT 5
- Noise While adding effects to input channel HOT 3
- App get crashed added the processor to the input channel during recording HOT 2
- App get crashed on some devices HOT 12
- Crash that seems to be about Events when no has been added/removed HOT 3
- while recording with SampleEvent and inputChannel recorded output get mismatched HOT 14
- Mic sound is very low in few devices HOT 5
- Thread issue maybe? HOT 10
- AudioRenderer.renderEvent Producing Noise HOT 6
- Is it possible to achieve stereo effect Using Single Input(mic)? HOT 2
- Is there any processor for noise reduction?
- Crashing when deleting events with the engine running HOT 1
- Is it possible to get hertz from the mic while recording? HOT 4
- volume issue with sample event HOT 2
- Multitrack audio recording HOT 1
- Remove events with sequencer playing HOT 17
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 mwengine.