Replace assertion for invalid audio formats by a runtime check.