Metadata-Version: 2.1
Name: traktor-nowplaying
Version: 0.0.8
Summary: traktor_nowplaying uses Traktor's broadcast functionality to extract metadata about the currently playing song.
Home-page: https://github.com/radusuciu/traktor_nowplaying
Author: Radu Suciu
Author-email: radusuciu@gmail.com
License: MIT License
Description: # Traktor Now Playing
        
        This project for Python 3 (tested on 3.7 and 3.8) uses Traktor's broadcast functionality to extract metadata about the currently playing song. This is really a very thin wrapper around some [tinytag](https://github.com/devsnd/tinytag) methods that can be found in `ogg.py`, where the original license is also included. There are no dependencies. Tested with Traktor 3.3, but this will likely work with older versions as well.
        
        The reason this exists is because it's rather difficult to get this information through other means. You can [use MIDI](https://github.com/Sonnenstrahl/traktor-now-playing) for this as well, but that requires that you add a fake controller.
        
        Lastly, there are several other projects that do something similar such as [Traktor Metadata Listener](https://www.disconova.com/utu/traktor-metadata/) which is not open-source and likely will never be, and [traktor-now-playing](https://github.com/Sonnenstrahl/traktor-now-playing), which uses the MIDI approach mentioned above.
        
        ## Installation
        
        The preferred installation method is via [pip](https://pip.pypa.io/en/stable/):
        
        ```bash
        pip install traktor_nowplaying
        ```
        
        Eventually, I'd like to leverage GitHub actions to automate the creation of binary releases using `pyInstaller` or something similar, but this is not setup at the moment.
        
        ## General use
        
        In order for this program to work, you of course have to setup the broadcasting feature of Traktor - note that this completely hijacks that functinality, so while you can still record and broadcast through some other means (eg. using a splitter or other outputs on your controller/mixer, or [from the recording itself](https://radusuciu.com/posts/broadcasting-from-traktor-an-alternative-to-the-built-in-broadcasting-function/)), you cannot broadcast from Traktor itself.
        
        You must configure Traktor to broadcast to `localhost` and the port specified with the `-p`, or `--port` option (defaults to `8000`), or the port that is passed to the constructor if you're using this as a library instead. For the format setting you can use anything, but I recommend choosing the lowest bitrate for the sample rate of your system, so most commonly the best choice is 44100 Hz, 64 Kbps.
        
        Note that there is a delay between when you change a song in Traktor and when the change is picked up.
        
        ## Use from command line
        
        Default options: listen on port `8000`, and output the currently playing song to the console:
        ```bash
        traktor_nowplaying
        ```
        
        Listen on port `8000`, output to `nowplaying.txt` in the current directory and do not output to `stdout`:
        ```bash
        traktor_nowplaying --port 8000 --outfile='nowplaying.txt' --quiet
        ```
        
        The help text:
        ```bash
        $ traktor_nowplaying -h
        usage: traktor_nowplaying [-h] [-p PORT] [-q] [-o OUTFILE] [--version]
        
        Use Traktor's broadcast functionality to extract metadata about the currently playing song
        
        optional arguments:
          -h, --help            show this help message and exit
          -p PORT, --port PORT  Port to listen on for broadcasts from Traktor
          -q, --quiet           Suppress console output of currently playing song
          -o OUTFILE, --outfile OUTFILE
                                Provide a file path to which the currently playing song should be written
          -v, --version         show program's version number and exit
        
        Note that you must configure Traktor to broadcast to localhost and the port specified with the -p, or --port option (defaults to 8000). For the format setting you can use anything, but I recommend
        choosing the lowest bitrate for the sample rate of your system, so most commonly the best choice is 44100 Hz, 64 Kbps.
        ```
        
        To stop the process `Ctrl + C` should suffice.
        
        ## Use as a library
        
        `traktor_nowplaying` can also be used as a library. This can be useful if you'd like to leverage this rather simple functionality in other code.
        
        ```python
        from traktor_nowplaying import Listener
        
        listener = Listener(port=8000, quiet=True, outfile='nowplaying.txt')
        listener.start()
        ```
        
        A more elaborate example with a custom callback:
        
        ```python
        # TODO: add example implementation
        ```
        
        
        ## Implementation details
        
        TODO
        
Platform: any
Classifier: Environment :: Console
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Intended Audience :: End Users/Desktop
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 3 - Alpha
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
