When I compiled the apk for Android, `NativeDecoder` was not found
Nayuta403 opened this issue · comments
Nayuta403 commented
Kaisei Sunaga commented
@Nayuta403
Oops, can you try switching to feature/refactor
branch instead?
This branch has one example Flutter app which can play music.
Nayuta403 commented
@SKKbySSK
Thanks, this problem no longer exists, but there are no examples of fft usage in the examples. In fact, I mainly want to see the use of fft here, there are other materials can refer to ?
Kaisei Sunaga commented
@Nayuta403
FFT is not supported by this package yet.
But you can combine this package and other fft libraries to run FFT. (such as https://pub.dev/packages/fftea)
This program will run the FFT on 440 Hz sine wave
// define the audio format with 48khz sample rate and stereo channels.
final format = AudioFormat(sampleRate: 48000, channels: 1, sampleFormat: SampleFormat.int16);
// create a sine wave function node with 440hz frequency.
final functionNode = FunctionNode(
function: const SineFunction(),
frequency: 440,
);
AllocatedAudioFrames(length: 1024, format: format).acquireBuffer((buffer) {
// read the audio data from the function node to the buffer.
functionNode.outputBus.read(buffer);
// floatList contains sine wave audio data.
final floatList = buffer.asFloat32ListView();
// Run FFT on the floatList here
final fft = FFT(floatList.length);
final freq = fft.realFft(floatList);
});