Commit graph

214 commits

Author SHA1 Message Date
Seth Alves
06618e81d0 remove unneeded <> 2017-07-12 13:14:32 -07:00
Seth Alves
ddf2312dc6 code review 2017-07-12 12:45:52 -07:00
Seth Alves
084a989a7a stopAndDeleteLater is now just stop 2017-07-11 21:21:42 -07:00
Seth Alves
3897ab2723 don't call deleteLater on smartpointered object 2017-07-11 20:16:00 -07:00
Seth Alves
c52e7e180a use const AudioInjectorPointer& in some places 2017-07-11 19:42:03 -07:00
Seth Alves
81489ea6c4 use QEnableSharedFromThis 2017-07-11 18:44:37 -07:00
Seth Alves
0b2f13dacc don't use deleteLater on smartpointered object 2017-07-11 17:07:44 -07:00
Seth Alves
3c8c87cff5 i hate you, milkman dan 2017-07-11 16:48:28 -07:00
Seth Alves
3670a04d8e switch bare pointers to AudioInjector objects to be QSharedPointers 2017-07-11 14:24:58 -07:00
Ken Cooke
986d86ec17 Fix nasty preexisting bug in computing numSamples, where sizeof(SAMPLE_SIZE) incorrectly returns 4 instead of 2. 2017-05-23 10:29:43 -07:00
Zach Pomerantz
48af83a960 guard against audio injector and local buffer datarace 2017-05-05 17:05:40 -04:00
Stephen Birarda
1b778a3ee0 fail quietly if local injection cannot happen 2017-01-20 10:42:07 -08:00
Ken Cooke
afacb59999 Use logarithmic quantization of injector "volume" over the wire.
Allow gains > 1.0 (up to +30dB)
Better quantization at low levels (uniform steps in dB)
2017-01-04 15:38:26 -08:00
Brad Hefta-Gaub
dbbed462b4 cleanup naked qDebug() calls 2016-12-19 22:24:25 -08:00
David Kelly
b68a07e930 Merge pull request #9197 from davidkelly/dk/injectorVolume
No longer applying volume when reading audio injector buffer
2016-12-16 15:11:33 -08:00
David Kelly
d6b99ce57e Removed volume from AudioInjectorLocalBuffer
Since it doesn't use it.  Now clamping at 0-1 in the
AudioInjector::getVolume() call.  This is better -- one spot so it now
always gets clamped.
2016-12-13 17:34:56 -08:00
Zach Fox
44c6eb303b Fix the bug 2016-12-13 12:46:31 -08:00
Ken Cooke
e93e1a7c4f Preliminary support for Ambisonic audio injectors.
Supports 4-channel WAV files, presumed to be B-format (FuMa) first-order Ambisonic.
Supports WAV with arbitrary sample rate (needs optimization).
Supports soundfield volume and orientation set via script.
Supports localOnly client-side injection using simple (non-spatialized) test renderer.
2016-12-02 18:20:57 -08:00
Zach Pomerantz
768354e49f loopback local injectors on server echo 2016-09-29 15:25:17 -07:00
Zach Pomerantz
faba165408 fix injector fail on lack of local if
- consolidate codepaths for new/restarted injections
- allow network injection without local injection
2016-09-23 15:03:38 -07:00
Zach Pomerantz
9e2ec27b29 always play audio injectors locally 2016-09-21 17:20:51 -07:00
Ken Cooke
3a41b285a0 Fix local audio injectors, that got disabled somehow 2016-09-13 17:21:48 -07:00
Brad Davis
ecfe56085d GLM update and GLI integration 2016-09-09 10:18:15 -07:00
Stephen Birarda
dae40c944b fix audio and audio-client compile for android 2016-08-31 16:55:19 -07:00
David Kelly
3d3a7a8820 Merge branch 'stable' of github.com:highfidelity/hifi into dk/hotfixForAudio 2016-07-22 18:40:06 -07:00
David Kelly
8b8a98bfcc Acutally audio was really broken
Seems there were 2 issues:
* If you couldn't inject locally (say, no audio interface
  because you are an assignment client), we would not do the
  network injection at all.  That's bad.
* When we don't have a codec, like when using an injector, we
  were serializing the empty string in some problematic way.  I
  just use the built-in serialization, and it seems fine.

I tested this by first playing a sound in the console (or maybe you
want to tip some cows, that is ok too).  Then in _another_ interface
client on another machine in the same domain, I better hear the
sound.

Then, I added a script to play audio as a persistent script, which
just loops forever and ever.  You should hear that on both interface
clients also.

A detailed test plan to follow.

Also: using @zappoman serialization code, which is safer than using
the Qt code which does magical things for nulls.  Good to do this cuz
you know, things happen...
2016-07-22 18:33:38 -07:00
Brad Hefta-Gaub
dbf60a594c Merge branch 'master' of https://github.com/highfidelity/hifi into addCodecNameToStream 2016-07-18 22:43:16 -07:00
Brad Hefta-Gaub
c6ffd81c4b some cleanup 2016-07-18 22:42:38 -07:00
Brad Hefta-Gaub
20824f038c include codec in audio stream packets so that each side can discard packets that don't match 2016-07-18 21:59:44 -07:00
David Kelly
2a89fa25bb Removing comments
Since I looked into it, seems ok
2016-07-18 16:22:12 -07:00
David Kelly
8c0eb1e4d2 Fixed some bad logic
When I "fixed" my or instead of and issue, I did it in the wrong
direction.  But it looked right :)  Now it is.  Sigh.  Long story
how it got there, but it seems good now.
2016-07-15 19:48:15 -07:00
David Kelly
fb99828e30 PR feedback
Code a bit more readable.  Sadly (and I guess it makes sense), a
enum class XXX is not a class, so you cannot have member functions
for it.  I can imagine no way to have a vtable if you are really
representing it as a uint8_t or whatever.  So, I put a stateHas
function in the AudioInjector instead.  Definite improvement.
2016-07-15 17:09:27 -07:00
David Kelly
8df4ed01d9 fixed typo
which oddly I was sure I already did.  Seems I didn't push it?  OK
now it is pushed.
2016-07-15 16:22:41 -07:00
David Kelly
e1212c54cb Updated to deal with streaming out of both buffers
So gotta keep track of when finished streaming to network and
locally separately.  That means the State needed to be more of a
bitflag and less of an enum.
2016-07-15 09:55:50 -07:00
David Kelly
dde4d16759 Merge branch 'master' of github.com:highfidelity/hifi into dk/firstLameAttempt 2016-07-13 15:15:35 -07:00
David Kelly
c951f507e3 Fixed issue with calling setOptions
Since the stereo option is computed from the .wav file, if you call
setOptions later (like the cow.js does), it resets stereo to false.
So, I now just copy the stereo flag into the new options, since the
sound file is the same.

Also, calling AudioClient::outputLocalInjector on the AudioClient
thread now to avoid potential concurrency issues accessing the
vector of injectors.
2016-07-13 11:28:36 -07:00
Brad Hefta-Gaub
7d608ba592 groundwork for injector support 2016-07-10 21:01:20 -07:00
Atlante45
07adef9465 Fix entities collision sounds 2016-05-05 14:55:28 -07:00
Atlante45
96ee33e80e Fix avatars collision sounds 2016-05-05 14:55:28 -07:00
Atlante45
6d1b7f1d37 Wrap sound script object to hold a strong ref 2016-04-06 13:04:18 -07:00
Howard Stearns
5d9ee84e63 Extend the test for number of active injectors to apply to injector restarts. 2016-02-23 10:42:39 -08:00
Stephen Birarda
d7990bf88a reset hasSentFirstFrame to false for double frame on first send 2016-01-29 14:55:08 -08:00
Stephen Birarda
d3028606c5 retart the nextFrame and frameTimer on injector restart 2016-01-29 14:47:27 -08:00
Stephen Birarda
0c2805db7e remove debug added to catch injector DOS 2016-01-28 15:50:04 -08:00
Stephen Birarda
311f1ac0e3 fix for overflow on time of next frame 2016-01-28 15:38:33 -08:00
Stephen Birarda
79c6ed9739 add some debug for AudioInjector DOS case 2016-01-28 12:22:36 -08:00
Ryan Huffman
2ec201b85e Fix conversion warning 2016-01-27 14:13:23 -08:00
Ryan Huffman
7e5eec55da Fix non-looped injected audio possibly looping 2016-01-27 13:47:32 -08:00
Ryan Huffman
4de8e7a3c8 Add audio resizing in injector 2016-01-27 13:47:09 -08:00
Ryan Huffman
8764eda479 Merge branch 'master' of https://github.com/highfidelity/hifi into injector-timing-fixes 2016-01-27 11:03:52 -08:00