1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
Commit Graph

143 Commits

Author SHA1 Message Date
tux3
87c4907054
Remove redundant source init code 2016-01-23 16:45:25 +01:00
tux3
a2fbc277fc
Replace audio check macros by functions 2016-01-23 16:45:25 +01:00
tux3
6cad8d8fe9
Remove redundant check starting audio thread
Thanks to @antis81 for spotting it
2016-01-23 16:45:25 +01:00
tux3
6425448196
Implement the playMono16Sound API sanely
This API used to start *A NEW THREAD* for every sound played!!

Now we simply have a dedicated source and buffer to play those sounds, we use a timer to cleanup the buffer 50ms after the sound is done playing (if a new sound hasn't started in the meantime)
2016-01-23 16:45:25 +01:00
tux3
ce2f8fd1d5
Cleanup and improve audio input
We now subscribe to an event and wait for frames when capturing audio
input, the big avdantage is that we only have to fetch the frames from
the hardware once, and we don't need to cache anything.
The frames are simply dispatched to the client's callbacks immediately.

Also removes some outdated ifdefs that did not apply anymore.
2016-01-23 16:45:25 +01:00
tux3
0a1833a74b
Un-pimpl
This makes the code much shorter and easier to follow, especially since AudioPrivate was right in the middle of audio.cpp, awkwardly splitting things in two

Compile times should not be substantially affected since we just need to include the OpenAL C headers
2016-01-23 16:45:25 +01:00
tux3
fb68d3750c
Cleanup mic feedback related code
It simply doesn't work, so let's do it right later
2016-01-23 16:45:25 +01:00
Nils Fenner
ffbd8fba91
do not warn, when requesting the volume from an invalid audio device
Instead, we return a defined value (0.0) and keep quiet otherwise.
2016-01-23 16:45:25 +01:00
Nils Fenner
9b5c799742
fix getter for audio master output volume
Return the ALListener's gain as "master" volume.
2016-01-23 16:45:25 +01:00
Nils Fenner
7d547b10eb
major changes to audio volume control
* use the ALListener object for master volume control
* initialize audio sources
* audio volumes are now expressed as percentage values between 0 and 1 to the public API
* removed artificial amplification of input samples
* removed invalid audio source generation in group calls
* minor: fixed gain slider max. value to 100 percent
2016-01-23 16:45:25 +01:00
Nils Fenner
a6024b85ea
initialize a subscribed audio source with "master" volume instead of "max." 2016-01-23 16:45:25 +01:00
Nils Fenner
b3926c8904
change method description of Audio::setOutputVolume to what it should do 2016-01-23 16:45:25 +01:00
apprb
d02348c1f8
Fix #2774: Client freezes after attempt to start group audio 2016-01-21 20:52:57 +06:00
Nils Fenner
82dfe0f704
fix audio singleton implementation 2016-01-09 13:12:39 +01:00
Nils Fenner
79ddbf7d02
open the first available audio in/out device as default, if specifier is empty 2015-12-28 12:06:22 +01:00
Nils Fenner
552155bd1f
Merge PR #2719 from antis81:fix_audio_subscriptions
* fix dangling audio output device
* do not resubscribe sid in copy constructor
2015-12-23 23:29:20 +01:00
Nils Fenner
19201dda8a
Merge pull request #2713 from antis81:newav_audio_cleanup 2015-12-20 23:10:03 +01:00
Nils Fenner
e73fd27d8b
fix: don't subscribe to in/out device when initialization failed 2015-12-20 09:45:43 +01:00
Nils Fenner
0615c7c3c6
reimplement audio in/out subscription concept 2015-12-20 09:45:43 +01:00
Nils Fenner
d8607324ce
cleanup AudioPrivate
* rename mAudioMeter -> audioMeter
* move class declaration below other classes
2015-12-20 09:45:43 +01:00
Nils Fenner
ace3662757
further improved audio metering
Give qTox time to do more important things -> do not measure with 100%.
2015-12-20 09:45:43 +01:00
Nils Fenner
535bb212f5
make use of QThread::requestInterruption 2015-12-20 09:45:43 +01:00
Nils Fenner
c39138a65d
lock mutex also on start/stop audio loop playback 2015-12-20 09:45:43 +01:00
Nils Fenner
08c43d0b83
cleanup OpenAL compatibility code in audio class 2015-12-20 09:45:43 +01:00
Nils Fenner
a1b87194b8
fix #2504
We need to filter samples * channels; also cleaned up data types
2015-12-20 09:45:43 +01:00
Nils Fenner
44d1c6fe74
[WIP] implement threaded level meter for input level
Issues:
1. Using 100% processor.
2. Temporary silences an active call -> reactivate after widget hide.

Still greatly improves metering audio data, removing "read buffer" errors.
2015-12-20 09:45:43 +01:00
Nils Fenner
5805c8c2bf
improved code for non-blocking audio player
Instead relying on hardcoded "d->alMainSource", we bind to the given OpenAL source instead.
2015-12-20 09:45:43 +01:00
Nils Fenner
67fbee8868
use qstring for path when playing audio file 2015-12-20 09:45:43 +01:00
Nils Fenner
b44ef6c596
introduce a non-blocking AudioPlayer
Also moved private stuff to private class.
2015-12-20 09:45:43 +01:00
Nils Fenner
1fb9bce78c
move audio class to thread before starting 2015-12-20 09:45:22 +01:00
Nils Fenner
bb7d2a72b7
privatized audio interface 2015-12-20 09:45:22 +01:00
Nils Fenner
c23cb0043f
implement actual audio in/out subscription management 2015-12-20 09:42:14 +01:00
Nils Fenner
137eca86d6
use single mutex for audio resource locking 2015-12-20 09:42:04 +01:00
Nils Fenner
68e7aef916
privatized open/close audio devices 2015-12-20 09:42:04 +01:00
Nils Fenner
f6c09104e4
fix noise (clipping) while (re-)initializing in/out audio device 2015-12-20 09:40:57 +01:00
Nils Fenner
d233c6f699
cleanup audio out device on error after open 2015-12-20 09:40:57 +01:00
Nils Fenner
d631ddbc86
cleanup close audio out device 2015-12-20 09:40:57 +01:00
Nils Fenner
32bc99fb38
cleanup reinitialization of changed audio in/out 2015-12-20 09:40:57 +01:00
Nils Fenner
ad6e0a85f5
add method to reinit audio in/out 2015-12-20 09:40:57 +01:00
Nils Fenner
7b98f2a4a0
cleanup close audio device 2015-12-20 09:40:57 +01:00
Nils Fenner
efda47a226
close audio output in destructor 2015-12-20 09:40:57 +01:00
Nils Fenner
c540faf271
add method to un-/subscribe to audio output as well 2015-12-20 09:40:57 +01:00
Nils Fenner
e8a4f6511d
use internal methods to open in/out audio devices 2015-12-20 09:40:57 +01:00
Nils Fenner
c5f4ceee6b
fix Audio::subscribeInput
Audio input/output device will only be opened, if not initialized already.
2015-12-20 09:40:57 +01:00
Nils Fenner
bde042ba3a
remove unused include and forward declarations 2015-12-20 09:40:57 +01:00
Nils Fenner
2ce92be94b
do not close output in unsubscribeInput and cleanup input internally instead 2015-12-20 09:40:57 +01:00
Nils Fenner
26fc424986
use internal cleanup methods to close in-/output devices 2015-12-20 09:40:57 +01:00
Nils Fenner
e2966b1457
open output device on "subscribeInput" only when not already opened 2015-12-20 09:40:57 +01:00
Nils Fenner
46b3ba2631
remove obsolete if 2015-12-20 09:40:57 +01:00
tux3
2b8200aa30
Fix audio timers started from wrong thread
This timer never actually worked
2015-12-19 17:07:19 +01:00
Jacob Henner
a405ceca9d Fixes #2631: Automatically select capture device. 2015-12-14 05:09:34 -05:00
tux3
31e62cfc5c
Fix loopback capture audio code 2015-12-10 22:04:40 +01:00
Anton Batenev
656696ebcb Add alext.h to audio.h
ALC_ALL_DEVICES_SPECIFIER may be defined in different headers of
libopenal (alext.h < 1.14 and alc.h >= 1.14). Seems there is no
harm in always include both.

Related commit is: @1d9e89f
2015-12-10 13:34:40 +03:00
Jacob Henner
1d9e89f318 qtox will now attempt to default to the first audio output device 2015-12-07 01:08:50 -05:00
tux3
cf52ff314f
Don't play sound without an output
And avoid the division by 0 when getting garbage info about nonexistent output sources
2015-11-07 22:24:17 +01:00
tux3
5c8dc1d7c9
Add None audio I/O devices
Can be changed in the middle of a call without problem
2015-11-07 18:23:10 +01:00
tux3
46fa4def20
Don't spam log dropped audio frames
Fixes #2507
2015-11-06 20:56:00 +01:00
tux3
995fc4cdda
Reload audio devices on the fly from settings 2015-10-24 02:59:12 +02:00
tux3
9163b73032
Refactor uses of playMono16Sound 2015-10-24 02:37:27 +02:00
tux3
aac5fb87e6
Add ringing sound for received calls
No sound for outgoing calls yet
2015-10-24 02:26:32 +02:00
tux3
08bde698ca
Apply input volume to all audio channels
Fixes #2452
2015-10-23 19:27:27 +02:00
tux3
f45256baf1 Implement group calls 2015-10-23 17:52:45 +02:00
tux3
e0aa8dd4a2 Implement audio calls 2015-10-23 17:39:08 +02:00
tux3
2b888ddc05 Better data structure for tox calls 2015-10-23 17:19:16 +02:00
tux3
512dc8de2d Implement basic call logic
We can now make New AV calls, but without any audio/video. Just opening a link.
2015-10-23 17:09:53 +02:00
tux3
dbbc702c60 Strip out old AV code 2015-10-23 17:02:01 +02:00
Rowen Stipe
e107de12c0 Compile on Mac
This set up added to current master compiles properly on Mac.

Includes pull #2436 fixes suggested by @antis81
2015-10-22 01:57:46 -04:00
Nils Fenner
cf8fa7b29c
remove unused include and forward declarations 2015-10-21 22:18:47 +02:00
Nils Fenner
82e1644d67
cleanup Audio::openOutput 2015-10-20 23:14:07 +02:00
Nils Fenner
3eb7b48d1c
cleanup Audio::openInput 2015-10-20 23:12:55 +02:00
Nils Fenner
b7cf4df13f
Get rid of static methods and bugs 2015-10-20 03:46:44 +02:00
Nils Fenner
54547af7cf
warn when trying to start audio thread twice 2015-10-20 03:42:02 +02:00
Nils Fenner
a675725a5e
change wording in docs 2015-10-20 03:41:18 +02:00
Nils Fenner
2bc3798aa0
remove dead & unfinished code 2015-10-19 21:59:47 +02:00
Nils Fenner
c8e003decb
further cleanup 2015-10-18 22:21:08 +02:00
Nils Fenner
8530acf079
fix asserts when (un-)subscribing input 2015-10-18 22:21:08 +02:00
Nils Fenner
59ca97e9b6
move docs to cpp 2015-10-18 22:21:08 +02:00
Nils Fenner
1c205b7c16
the big code cleanup
* Get rid of static vars and methods and move mutexes to right places.
* Use static wrappers for the moment to retain compatibility.
2015-10-18 22:21:08 +02:00
Nils Fenner
2a2cba3cf2
remove outcommented code 2015-10-18 22:21:08 +02:00
Nils Fenner
932d9b7c9b
Audio: Fix device open only when needed 2015-10-18 22:21:08 +02:00
TheSpiritXIII
bbbd450b6a
Audio: Only open mic when requested 2015-10-18 22:21:08 +02:00
TheSpiritXIII
868381fe3f
Audio: Don't need this? 2015-10-18 22:21:08 +02:00
TheSpiritXIII
61eb302ff7
Audio: Fix crash when no devices available 2015-10-18 22:21:08 +02:00
TheSpiritXIII
a311b96376
Audio: Open output only when necessary 2015-10-18 22:21:08 +02:00
Nils Fenner
a2a32b61c4
Audio: persistent volume sliders, mic feedback and volume 2015-10-18 22:21:08 +02:00
agilob
ec3ccc7ca3
remove qdebug from audio.cpp:270 2015-10-18 10:18:13 +01:00
agilob
d875221e53
remove unused code, removed unused checks 2015-10-18 10:18:06 +01:00
agilob
266c0fb989
Merge branch TheSpiritXIII:video 2015-10-10 13:49:30 +01:00
tux3
8fbc0c8b59
Remove some debug output fluff 2015-09-06 00:11:47 +02:00
TheSpiritXIII
814bd922ca Video: Group audio view avatars 2015-08-18 13:40:11 -04:00
tux3
aeb9a7f62f
Fix some warnings 2015-06-08 11:46:38 +02:00
Zetok Zalbavar
67e9aeec63
Fix incorrect copyright headers
The qTox Project is not associated with the Tox Project in any way, with the
exception of "qTox" using the Tox Projet's "toxcore" collection of libraries.
In particular, the Tox Projet does not own copyright over the qTox Project's
"qTox" collection of software, source code, and assets.
The qTox Project's assets are under the sole copyright of the qTox
contributors, and no partiular rights are granted to the Tox Project.
2015-06-06 14:51:28 +01:00
tux3
20f254651d
Reorganize files 2015-06-06 01:44:47 +02:00