Download the PHP package valzargaming/php-osc without Composer
On this page you can find all versions of the php package valzargaming/php-osc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download valzargaming/php-osc
More information about valzargaming/php-osc
Files in valzargaming/php-osc
Package php-osc
Short Description Open Sound Control (OSC) Client Library for PHP
License
Informations about the package php-osc
Installation
Install the dependencies with Composer:
Run composer install to install the project dependencies.
Bot example
A production-ready example, bot.php, is included. It sends periodic OSC messages (sender-only).
Listener and acknowledgement functionality has been moved to the separate entrypoint script osc_listener.php.
Environment variables for bot.php:
OSC_DEST– remote IP to send messages to (default127.0.0.1)OSC_PORT– remote port to send messages to (default9000)OSC_INTERVAL– send interval in seconds (default5)OSC_ADDRESS– OSC address for heartbeat messages (default/bot/heartbeat)
Examples:
Run the bot with defaults:
Send to a custom destination:
Start the separate listener (acknowledgement service) in another terminal:
Examples
See examples.md for more usage examples, including the ReactPHP UDP server (server.php) and how to run it together with bot.php for end-to-end testing.
php-osc
PSR-4 version of Open Sound Control (OSC) Client Library for PHP
Authors:
- Andy W. Schmeder [email protected] (original, 2003-2007)
- Jason Soares [email protected] (PSR-4 update)
- Valithor Obsidion [email protected] (maintainer, 2026-present)
Copyright:
- Copyright (c) 2003-2007 Andy W. Schmeder
- Copyright (c) 2026-present Valithor Obsidion
Version: 2.0
Requirements: PHP >= 8.1.2
For information about Open Sound Control, see http://www.opensoundcontrol.org/
Known Issues
- Listener callbacks in automated tests: The earlier external-process integration test (starting
server.phpandosc_listener.phpas detached processes) failed to observe the server->listener callback in the automated PHPUnit run on Windows. This was caused by process-start timing and platform-specific spawn/quoting behavior. As a result we now provide an in-process integration test that is reliable under PHPUnit: tests/IntegrationTest.php. -
Manual run that did work: A manual interactive run did exercise the end-to-end flow successfully — start the server and listener, send a probe, and observe the callback/ack cycle in the logs. Example commands used interactively in PowerShell:
-
Start the server (foreground):
php server.php
-
Start the listener (foreground):
php osc_listener.php
-
Send a probe to trigger the server callback (helper script):
php tests/probe_9001.php
The listener log (osc-listener.log) then shows the received probe and the ack sent back.
-
- Why this matters: If you rely on automated external-process integration tests on Windows CI, prefer the in-process ReactPHP test harness provided in tests/IntegrationTest.php or run the manual commands interactively. If you want the external-process test to work in CI, it may require platform-specific adjustments to process startup and timeouts.
All versions of php-osc with dependencies
ext-sockets Version *
react/datagram Version ^1.8
trafficcophp/bytebuffer Version ^0.3
react/event-loop Version ^1.2