add tone generater API and test code