        .find(|f| f.sample_format() == config::SAMPLE_FORMAT && f.channels() == 1)
        .expect("no supported format?!")
        .with_sample_rate(cpal::SampleRate(config::SAMPLE_RATE as _));

    let socket =
        UdpSocket::bind((config::TRANSMITTER_BIND_ADDR, config::TRANSMITTER_BIND_PORT)).unwrap();
    socket.set_broadcast(true).unwrap();

    let input_config = input_format.into();
    let stream = input_device
        .build_input_stream(
            &input_config,
            move |data: &[config::Sample], _info| {