aboutsummaryrefslogtreecommitdiff
path: root/src/talker.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-10-22 23:53:29 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-10-22 23:53:29 +0300
commitf45b143dcf90970122436d10bd6226f577a9310d (patch)
tree986563759bf1f5935e15a66613e673e445b26e97 /src/talker.c
parentf4c66a4c77e5818ca9703f59a80ea92e27ed45c6 (diff)
works with alsa and runs at 30 fpsHEADmaster
Diffstat (limited to 'src/talker.c')
-rw-r--r--src/talker.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/talker.c b/src/talker.c
index e7271ad..d70df52 100644
--- a/src/talker.c
+++ b/src/talker.c
@@ -14,10 +14,11 @@
#define Y_RES 120
camera_handle cam_handle;
+audio_handle aud_handle;
void on_send(message *m)
{
- audio_record(m->audio);
+ audio_record(&aud_handle, m->audio);
m->WIDTH = X_RES;
m->HEIGHT = Y_RES;
@@ -34,11 +35,19 @@ int main(void)
camera_init(&cam_handle, params);
+ if(audio_create(&aud_handle, RECORD) != 0) {
+ err("audio_create: failed\n");
+ return 1;
+ }
+
+ info("created audio\n");
+
if(talker("4950", "localhost", &on_send) != 0) {
err("talker: failed\n");
return 1;
}
+ audio_destroy(&aud_handle);
camera_deinit(&cam_handle);
return 0;
}