Simplifies the code by using List.of, List.copyOf etc. where possible which results in less code and imports.
Signed-off-by: Wouter Born <github@maindrain.net>
Stream.toList was introduced in Java 16 and creates an unmodifiable List so it can be used to simplify code whenever the List is not expected to be modified.
Signed-off-by: Wouter Born <github@maindrain.net>
Instead of 5s before.
It helps triggering the end of playback earlier for audio sinks in asynchronous mode.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Allows the use of a Sizeable interface (for AudioStream that we know the length of, but we cannot clone). We can then improve the duration detection, for example for the pulseaudio sink (PR coming after).
We can also give the length information to sink in more cases.
Add the support of the mark / reset methods to some common AudioStream. We then allow more stream analysis for sink requiring it (Stream analysis often requires to get back in time after consuming a few bytes)
Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
* [audio] More capabilities for AudioSink using the AudioServlet
AudioServlet can now serve all type of AudioStream multiple times by buffering data in memory or in temporary file.
Adding method to ease disposal of temporary file after playing a sound
Adding an identifyier to audio stream for further development (allow audio sink to cache computation data)
We can now send audio with a Runnable for a delayed task to be executed after. This delayed task includes temporary file deletion and volume restoration.
This is a no breaking change / no behaviour modification for other addon AudioSink, as existing AudioSink must explicitly override the old behaviour to use this capability.
Add AudioSinkSync / AudioSinkAsync abstract classes to use this capability easily.
WebAudioSink now implements this capability, with the help of a modified AudioServlet
Adding (approximative, better than nothing) sound duration computation method for MP3 and WAV.
Use this sound duration computation to guess when the async sound is finished and when to do the post process (i.e. volume restoration)
Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
* New translations audio.properties (Romanian)
* New translations addons.properties (Romanian)
* New translations i18n.properties (Romanian)
* New translations network.properties (Romanian)
* New translations marketplace.properties (Romanian)
* New translations validation.properties (Finnish)
* New translations scriptprofile.properties (French)
* New translations scriptprofile.properties (Slovenian)
* New translations validation.properties (Hebrew)
* New translations validation.properties (Polish)
* New translations validation.properties (Slovenian)
* New translations hli.properties (French)
* New translations hli.properties (Polish)
* New translations automation.properties (Hebrew)
* New translations automation.properties (Polish)
* Sync runtime dependencies with Karaf 4.4.3, most notably:
* Jetty 9.4.50.v20221201
* Pax Logging 2.2.0
* Pax Web 8.0.15
* Use OSGi R8 as compile dependency
* Rework Servlets to use Http Whiteboard annotations in favor of proprietary `org.openhab.core.io.http.servlet` classes
* Resolve itest runbundles
Also-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Wouter Born <github@maindrain.net>
* [voice] Add notification sounds to dialog processor
* [audio] add actions and commands to play melodies
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
* New translations messages.properties (Danish)
* New translations audio.properties (Danish)
* New translations inbox.properties (Danish)
* New translations addons.properties (Danish)
* New translations persistence.properties (Danish)
* New translations lsp.properties (Danish)
* New translations sitemap.properties (Danish)
* New translations SystemThingStatusInfos.properties (Danish)
This fixes the build being broken when building on Windows.
It also contains many fixes for timing issues which seem to impact macOS and Windows more than Linux.
* Fix .gitattributes and add *.xml_gen to fix line ending issues on Windows
* Derive fork count from CPU details in org.openhab.core tests for more stable tests on machines with fewer cores
* Adjust SafeCallerImplTest timings
* Increase ExecUtilTest timeout
* Increase SchedulerImplTest timeouts
* Increase AudioConsoleTest serveStream timeout
* Increase AudioServletTest serveStream timeout
* Increase SchedulerImplTest test timeouts
* Increase ExpireManagerTest timeout used for checking published events
* Increase PeriodicSchedulerImplTest max allowed delta
* Increase SchedulerImplTest timeouts
* Fix BundleInfoReader file stream not closed causing temp dir deletion issues on Windows
* Fix GenerateDefaultTranslationsMojoTest Windows line endings issues
* Fix GenerateDefaultTranslationsMojoTest Windows temp dir deletion problem
* Fix GenericItemProviderTest tearDown sometimes fails because of queued events
* Fix ChannelLinkNotifierOSGiTest wait for channel link events
* Fix ChannelCommandDescriptionProviderOSGiTest fails if provider not immediately registered
* Fix ChannelStateDescriptionProviderOSGiTest fails if provider not immediately registered
* Fix GenericItemChannelLinkProviderTest not waiting for async updated state to become true
* Fix GenericThingProviderTest failing due to events of previous test
* Fix InboxOSGiTest sometimes fails because of queued events
* Fix ScriptEngineOSGiTest failing because items are not yet added to registry
* Fix ThingManagerOSGiTest failing due to async handleRemoval call
Signed-off-by: Wouter Born <github@maindrain.net>
* Add more null annotations
* Fix mock name
Adds null annotations to most of the tests as well as a few other classes.
Also fixes a few other SAT findings.
Fixes ~300 SAT findings in total.
Signed-off-by: Wouter Born <github@maindrain.net>
* [audio] Remove 'clac' noise when playing wav (javasound)
A 'clac' can be heard at the beginning of a wav file when playing on the javasound sink.
Close#2669
Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>