faithoflifedev / easy_onvif_workspace

This package works with a variety of ONVIF compatible devices allowing for IP Cameras and NVRs (network video recorders) to be integrated into Dart and Flutter applications.
33 stars 21 forks source link

How send audio stream to camera ? #51

Closed alishe79 closed 11 months ago

alishe79 commented 11 months ago

I wanna send audio to unv or any vendor camera support play sound in camera. easy_onvif support this ? if yes, how can i stream audio to camera using easy_onvif ?

faithoflifedev commented 11 months ago

Hello @alishe79,

This library and Onvif in general does not have any direct support for sending audio to a device.

You can use easy_onvif to get the RTSP audio stream uri, then you'll have to find another library to send or receive audio on that stream. Here's some sample code in c-sharp that i was able to find - how-to-send-audio-on-rtsp-backchannel

You might also be able to test sending an audio stream to the device with the command line tool - ffmpeg

alishe79 commented 11 months ago

Thank you @faithoflifedev

can i get the only audio by uint8list ? i wanna run audio byte array in audio Tflite model. how i can do this ?

alishe79 commented 11 months ago

@faithoflifedev my default class, use mobile microphone .


        try {
            classifier = AudioClassifier.createFromFileAndOptions(context, currentModel, options)
            tensorAudio = classifier.createInputTensorAudio()
            recorder = classifier.createAudioRecord()
            startAudioClassification()
        } catch (e: IllegalStateException) {
            listener.onError(
                "Audio Classifier failed to initialize. See error logs for details"
            )

            Log.e("AudioClassification", "TFLite failed to load with error: " + e.message)
        }

Example