Comments (8)
@MaayanBogin
Thanks for reporting issue.
It looks like the version 0.0.5 of coast_audio
introduced this breaking changes.
If you are not going to use the WavAudioDecoder
class, you can downgrade your coast_audio
dependency to 0.0.4
to fix the problem.
from coast_audio.
@SKKbySSK
Thanks for the quick response!
I'm only importing flutter_coast_audio_miniaudio: ^0.0.4
, is there a version that is depended on a older version of coast_audio
?
Edit: Tried 0.03 and it didn't work, Is there a workaround from changing the pubspace.yaml?
from coast_audio.
Hello again! Hate to bug about this again but I cant seem to get it to work, Also it seems that flutter_coast_audio_miniaudio 0.0.4 is already dependant on coast_audio: ^0.0.4 and flutter_coast_audio_miniaudio: ^0.0.4
edit: When I try to just use coast_audio: ^0.0.4 and coast_audio_miniaudio: ^0.0.4 I still encounter the error, when using flutter_coast_audio_miniaudio and getting the error ma_bridge is mentioned, maybe somthing with its installation? I tried using WavAudioDecoder but id rather decode the mp3 audio
Is there a version of flutter_coast_audio_miniaudio that i can use that wont give me the The method 'setString' isn't defined for the class 'Array<Char>'.
error?
from coast_audio.
@MaayanBogin
When you write ^
to the dependency, it will be resolved as a version range in >=0.0.4 <1.0.0
. (reference)
Can you write coast_audio: 0.0.4
instead of ^0.0.4
?
from coast_audio.
@SKKbySSK Thanks for the response but I am officially really confused,
I tried coast_audio: 0.0.4 , returned the same error, but its telling me I dont need the lib because of import flutter_coast_audio_miniaudio.dart';? so I dont need to import coast_audio(?)
Im not sure what lib to import anymore from all the repos pointing at smth else. Here are my imports
import 'dart:async';
import 'dart:ffi' as ffi;
import 'dart:io';
import 'dart:math' as math;
import 'dart:typed_data';
import 'package:fftea/fftea.dart'
//import 'package:coast_audio/coast_audio.dart'; *Note this is not used
import 'package:flutter_coast_audio_miniaudio/flutter_coast_audio_miniaudio.dart';
Here is the relevant code regarding the decoding
final dataSource = AudioFileDataSource(file: file, mode: FileMode.read);
// Determine the output format (assuming you know the format)
final outputFormat =
AudioFormat(sampleRate: 44100, channels: 1); // Adjust as needed
// Create a buffer size
final bufferSize = 4096;
// Use ffi to allocate memory for the buffer
final pBuffer = memory.allocator.allocate<ffi.Uint8>(bufferSize);
// Create a MabAudioDecoder
final decoder =
MabAudioDecoder(dataSource: dataSource, outputFormat: outputFormat);
//final decoder = WavAudioDecoder(dataSource: dataSource); **Not used for now
final audioData = <double>[];
// Decode audio data in chunks
while (true) {
final decodeResult = await decoder.decode(
destination: AudioBuffer(
pBuffer: pBuffer,
sizeInBytes: bufferSize,
sizeInFrames: bufferSize ~/ outputFormat.channels,
format: outputFormat,
memory: memory, // Pass the memory instance
),
);
// Check if decoding is finished
if (decodeResult.isEnd) {
break;
}
// Convert the decoded data in memory to a Dart List<double>
for (var i = 0; i < decodeResult.frames * outputFormat.channels; i++) {
final byte = pBuffer.elementAt(i).value;
audioData.add(byte.toDouble());
}
}
Little side note : At this point I'm starting to get really confused, I'm not sure what to import and what statements to call, I simply need to decode mp3 audio data so i can do spectrum analyzation using fft, I'm sorry this is taking so long to resolve and I'm sure better developers would get through this quickly but I cant seem to get MabAudioDecoder or any MabAudio to be called while using flutter_coast_audio_miniaudio
because it gives me the "'setString' isn't defined" error but when I try to use coast_audio
there simply is no way to decode mp3
please help me :')
from coast_audio.
@MaayanBogin you don't need the import 'package:coast_audio/coast_audio.dart'
statement in the source files; just add coast_audio: 0.0.4
to your pubspec.yaml
(but keep flutter_coast_audio_miniaudio
there too) so that flutter doesn't try to update the transitive dependency on coast_audio
to 0.0.5 and everything should work.
from coast_audio.
Hello :) do you have plans on addressing this issue with flutter_coast_audio_miniaudio?
from coast_audio.
@MaayanBogin
There is a plan for the next stable release.
flutter_coast_audio_miniaudio
and coast_audio_miniaudio
will be integrated to the coast_audio
package.
(and it will introduces some breaking changes)
It should be released soon.
from coast_audio.
Related Issues (20)
- this lib can convert flac to wav format? HOT 4
- Play asset wav file HOT 7
- Q: How to output left or right audio out channels? HOT 2
- Real-time spectrogram analysis HOT 9
- License Requirement
- InterceptorNode would be handy in the coast_audio package HOT 2
- Issues with audio data processing and conversion HOT 4
- How to convert SampleFormat.int16 to SampleFormat.float32 suitable for FFT HOT 7
- Pitch recognition HOT 5
- Bug: unsupported format found in riff chunk: WAVE- HOT 5
- When I compiled the apk for Android, `NativeDecoder` was not found HOT 4
- coast_audio 1.0.0 decoding
- Building 'example' app on x86_64 Windows system fails HOT 5
- Error: Invalid argument(s): Failed to load dynamic library 'libcoast_audio.so': dlopen failed: library "libcoast_audio.so" not found HOT 3
- Running Audio Recorder from example app on iOS: RangeError: Invalid value: Not in inclusive range 0..3: 4 HOT 1
- FX on Audio Stream HOT 2
- version solving failed in examples/audio_recorder HOT 4
- Is the `flutter_coast_audio_miniaudio` support ios simulator? HOT 2
- Question : Filtering Audio with Miniaudio's built-in Filters? HOT 3
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 coast_audio.