Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Recording and sending audio.  (Read 2658 times)

0 Members and 1 Guest are viewing this topic.

BartekMaciag

  • Newbie
  • *
  • Posts: 4
    • View Profile
Recording and sending audio.
« on: January 12, 2014, 03:06:59 pm »
I want to create voice chat in my little game it looks like this:
for(;;)
{
    recorder.start();
    recorder.stop();
    send(recorder.getbuffer());
}

It doesn't work but I tried something another ...:
recorder.start();
send(recorder.getbuffer());


this too didn't work, I have to record and send it at the same time, please help me  Bartek.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: Recording and sending audio.
« Reply #1 on: January 12, 2014, 03:14:31 pm »
You need to learn more about programming and especially on the topics of audio processing and streaming. I can only guess, but I'd say SFML is not the best library to implement voice chat with.

Also "doesn't work" is not a problem description, read this post.

And for posting code you should always use the [ code=cpp ] tag.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Recording and sending audio.
« Reply #2 on: January 12, 2014, 03:19:22 pm »
  • Record audio into a buffer
  • When buffer is full send it to the client
  • Receive the audio data and load it into a sound buffer
  • Play the sound buffer
  • Goto 1

It is very much possible with SFML, but unless you learn more about coding/streaming/audio processing as eXpl0it3r said you will have a hard time making it work.  ;)
« Last Edit: January 12, 2014, 03:21:32 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

BartekMaciag

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Recording and sending audio.
« Reply #3 on: January 12, 2014, 04:51:37 pm »
  • Record audio into a buffer
  • When buffer is full send it to the client
  • Receive the audio data and load it into a sound buffer
  • Play the sound buffer
  • Goto 1

It is very much possible with SFML, but unless you learn more about coding/streaming/audio processing as eXpl0it3r said you will have a hard time making it work.  ;)


it's beside the point, what I mean is record and send file at the same time when the record is not over.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Recording and sending audio.
« Reply #4 on: January 12, 2014, 05:13:59 pm »
it's beside the point, what I mean is record and send file at the same time when the record is not over.

And this is how you do it....
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor