<?php
require 'TeamSpeak3/TeamSpeak3.php';
$user = 'serveradmin';
$password = 'password';
$ip_query = '1.2.3.4:10011';
$port = 9987;
$ts3 = TeamSpeak3::factory("serverquery://$user:$password@$ip_query/?server_port=$port");
foreach($ts3->channelList() as $channel) {
$properties = array();
if($channel['channel_codec'] != 4) $properties['channel_codec'] = 4;
if($channel['channel_codec_quality'] != 10) $properties['channel_codec_quality'] = 10;
if(!empty($properties)) {
$properties['cid'] = $channel['cid'];
$ts3->execute('channeledit', $properties);
}
}