Jump to content
  • entries
    943
  • comments
    5,899
  • views
    924,400

Final sound recording API


Josh

1,898 views

 Share

My Gigabyte Brix pro lacks an audio in port and I was not able to find a USB microphone yesterday. However, I found a cheap webcam with audio support and have been using this to test voice recording, and it works great. Here is the final voice recording API:

bool Sound::StartRecording(const int frequency = 22050, const int format = Sound::Mono8, const int buffersize = 20480)
Sound* Sound::StopRecording()
bool Sound::StopRecording(Lobby* lobby)
lobby->SetVoiceFilter(const uint64 steamid, const bool block)

And in Leadwerks 5:

bool StartRecording(const int frequency = 22050, const int format = SOUND_MONO8, const int buffersize = 20480)
shared_ptr<Sound> StopRecording()
bool StopRecording(shared_ptr<Lobby> lobby)
lobby->SetVoiceFilter(const uint64 steamid, const bool block)

The first overload of the StopRecording function will return a Leadwerks sound object you can play, and then second version of the function will broadcast your recorded audio to all players in the specified lobby. The SetVoiceFilter() method in the Lobby class can be used to block some players from receiving your voice audio, so the game can make voice chat private for your team.

The lobby and peer-to-peer networking system are also done, so in theory we have everything we need right now to make multiplayer games. An update will be out soon on the beta branch so you can start testing these new features.

  • Like 1
 Share

3 Comments


Recommended Comments

12 minutes ago, Rick said:

Is this available in Lua?

Maybe some of it. I would stick to C++ right now.

Link to comment
5 hours ago, Josh said:

Maybe some of it. I would stick to C++ right now.

Man, I haven't used C++ in a long time. I'll just start with a single player with AI version of this first with the idea of adding these multiplayer AI later when the Lua API is available. All my helper libs I've created over the years are for Lua so it's just way easier for me to work in that.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...